[3.0] Handle NULL pointer for UTC on target 04/54804/1 accepted/tizen/mobile/20151218.090651 accepted/tizen/tv/20151218.090545 accepted/tizen/wearable/20151218.090624 submit/tizen/20151218.063133
authortaeyoon <taeyoon0.lee@samsung.com>
Fri, 18 Dec 2015 04:24:09 +0000 (13:24 +0900)
committertaeyoon <taeyoon0.lee@samsung.com>
Fri, 18 Dec 2015 04:25:29 +0000 (13:25 +0900)
Change-Id: I0cac9d518a65b4c1b48037705b6182434ed9ae26

adaptors/common/virtual-keyboard-impl.cpp

index bc16c05..c38f276 100644 (file)
@@ -134,11 +134,16 @@ void DisconnectCallbacks( Ecore_IMF_Context *imfContext )
 void Show()
 {
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) to show the keyboard
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+  Ecore_IMF_Context* imfContext = NULL;
 
-  if( imfContext )
+  if( imfManager )
   {
-    ecore_imf_context_input_panel_show( imfContext );
+    imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+
+    if( imfContext )
+    {
+      ecore_imf_context_input_panel_show( imfContext );
+    }
   }
 }
 
@@ -205,11 +210,16 @@ void ApplySettings( const Property::Map& settingsMap )
 void EnablePrediction(const bool enable)
 {
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) when enabling prediction
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+  Ecore_IMF_Context* imfContext = NULL;
 
-  if ( imfContext )
+  if( imfManager )
   {
-    ecore_imf_context_prediction_allow_set( imfContext, (enable)? EINA_TRUE : EINA_FALSE);
+    imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+
+    if ( imfContext )
+    {
+      ecore_imf_context_prediction_allow_set( imfContext, (enable)? EINA_TRUE : EINA_FALSE);
+    }
   }
 }
 
@@ -239,16 +249,21 @@ Rect<int> GetSizeAndPosition()
 
   width = height = xPos = yPos = 0;
   Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) as we may need to do some size related setup in the application
-  Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+  Ecore_IMF_Context* imfContext = NULL;
 
-  if( imfContext )
+  if( imfManager )
   {
-    ecore_imf_context_input_panel_geometry_get(imfContext, &xPos, &yPos, &width, &height);
-  }
-  else
-  {
-    DALI_LOG_WARNING("VKB Unable to get IMF Context so GetSize unavailable\n");
+    imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+
+    if( imfContext )
+    {
+      ecore_imf_context_input_panel_geometry_get(imfContext, &xPos, &yPos, &width, &height);
+    }
+    else
+    {
+      DALI_LOG_WARNING("VKB Unable to get IMF Context so GetSize unavailable\n");
     // return 0 as real size unknown.
+    }
   }
 
   return Rect<int>(xPos,yPos,width,height);