Fix to avoid DEREF_AFTER_NULL Svace issue in any.h 25/117825/3
authorPaul Wisbey <p.wisbey@samsung.com>
Tue, 7 Mar 2017 13:22:34 +0000 (13:22 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 21 Mar 2017 16:55:53 +0000 (09:55 -0700)
Change-Id: I4e87718579bc208fccf498bc3204b109303abb84

dali/public-api/object/any.h

index 121d266..f28ed48 100644 (file)
@@ -176,14 +176,11 @@ public:
   template<typename Type>
   const Type& Get() const
   {
-
     if ( NULL == mContainer )
     {
       AssertAlways( "Any::Get(). mContainer is NULL" );
     }
-
-    // Check if the value has the same value than the Any type.
-    if( mContainer->GetType() != typeid( Type ) )
+    else if( mContainer->GetType() != typeid( Type ) ) // Check if the value has the same value than the Any type.
     {
       AssertAlways( "Any::Get(). Trying to retrieve a value of a different type than the template one." );
     }