Fixed abort issue by NULL in Region/Language changed callback 70/162070/4
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Wed, 29 Nov 2017 02:58:37 +0000 (11:58 +0900)
committertaeyoon0.lee <taeyoon0.lee@samsung.com>
Wed, 29 Nov 2017 11:18:01 +0000 (20:18 +0900)
Change-Id: Ia5204b649cd9495b19206e0d3bb2d84749f301c5

adaptors/tizen/framework-tizen.cpp

index 5063414..9628bdd 100644 (file)
@@ -412,8 +412,16 @@ struct Framework::Impl
   {
     Framework* framework = static_cast<Framework*>(data);
     Observer *observer = &framework->mObserver;
-    framework->SetLanguage( std::string( static_cast<const char *>(event->value) ) );
-    observer->OnLanguageChanged();
+
+    if( event && event->value )
+    {
+      framework->SetLanguage( std::string( static_cast<const char *>(event->value) ) );
+      observer->OnLanguageChanged();
+    }
+    else
+    {
+      DALI_LOG_ERROR( "NULL pointer in Language changed event\n" );
+    }
   }
 
   static void AppDeviceRotated(AppCore::AppEventInfoPtr event_info, void *data)
@@ -424,8 +432,16 @@ struct Framework::Impl
   {
     Framework* framework = static_cast<Framework*>(data);
     Observer *observer = &framework->mObserver;
-    framework->SetRegion( std::string( static_cast<const char *>(event->value) ) );
-    observer->OnRegionChanged();
+
+    if( event && event->value )
+    {
+      framework->SetRegion( std::string( static_cast<const char *>(event->value) ) );
+      observer->OnRegionChanged();
+    }
+    else
+    {
+      DALI_LOG_ERROR( "NULL pointer in Region changed event\n" );
+    }
   }
 
   static void AppBatteryLow(AppCore::AppEventInfoPtr event, void *data)