From: Adeel Kazmi Date: Fri, 18 Jan 2019 14:09:32 +0000 (+0000) Subject: (AnimatedVectorImages) Fixed SVACE error X-Git-Tag: dali_1.4.4~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=fbb3e4230389ffa6f2acb4b2ff3e9ceaa8583a66 (AnimatedVectorImages) Fixed SVACE error Ensure we check that the value was actually found in the map before we dereference it. Change-Id: Ib772c9b0812eeb3123e734888eab467ee7f83d58 --- diff --git a/examples/animated-vector-images/animated-vector-images-example.cpp b/examples/animated-vector-images/animated-vector-images-example.cpp index d7e4f8a..4e6656a 100644 --- a/examples/animated-vector-images/animated-vector-images-example.cpp +++ b/examples/animated-vector-images/animated-vector-images-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,17 +157,20 @@ private: Property::Map map = imageView.GetProperty< Property::Map >( ImageView::Property::IMAGE ); Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE ); - if( value->Get< int >() != static_cast< int >( DevelImageVisual::PlayState::PLAYING ) ) + if( value ) { - mPlayButtons[controlIndex].SetProperty( Button::Property::LABEL, "Pause" ); + if( value->Get< int >() != static_cast< int >( DevelImageVisual::PlayState::PLAYING ) ) + { + mPlayButtons[controlIndex].SetProperty( Button::Property::LABEL, "Pause" ); - DevelControl::DoAction( imageView, ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::PLAY, Property::Value() ); - } - else - { - mPlayButtons[controlIndex].SetProperty( Button::Property::LABEL, "Play" ); + DevelControl::DoAction( imageView, ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::PLAY, Property::Value() ); + } + else + { + mPlayButtons[controlIndex].SetProperty( Button::Property::LABEL, "Play" ); - DevelControl::DoAction( imageView, ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::PAUSE, Property::Value() ); + DevelControl::DoAction( imageView, ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::PAUSE, Property::Value() ); + } } return true;