(VirtualKeyboard) Adding Guard around ImfManager::Get() so if fails functions are... 04/17704/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 6 Mar 2014 16:26:04 +0000 (16:26 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Fri, 7 Mar 2014 14:09:00 +0000 (14:09 +0000)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution]
[Verification] Build Repo

Change-Id: Ieb0fe71064b95ba14ee6363d57051b5a4b87f4f2
Signed-off-by: Paul Wisbey <p.wisbey@samsung.com>
adaptors/tizen/internal/common/virtual-keyboard-impl.cpp

index 9f886c6..c6f4765 100644 (file)
@@ -303,17 +303,21 @@ Dali::VirtualKeyboard::TextDirection GetTextDirection()
   if ( Dali::Adaptor::IsAvailable() )
   {
     Dali::ImfManager imfManager = ImfManager::Get();
-    Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
 
-    if ( imfContext )
+    if ( imfManager )
     {
-      char* locale( NULL );
-      ecore_imf_context_input_panel_language_locale_get( imfContext, &locale );
+      Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
 
-      if ( locale )
+      if ( imfContext )
       {
-        direction = Locale::GetTextDirection( std::string( locale ) );
-        free( locale );
+        char* locale( NULL );
+        ecore_imf_context_input_panel_language_locale_get( imfContext, &locale );
+
+        if ( locale )
+        {
+          direction = Locale::GetTextDirection( std::string( locale ) );
+          free( locale );
+        }
       }
     }
   }