[Tizen] Fix window cast crash issue 05/222805/2 accepted/tizen/5.5/unified/20200121.041227 submit/tizen_5.5/20200120.082613
authorSeungho, Baek <sbsh.baek@samsung.com>
Mon, 20 Jan 2020 07:34:04 +0000 (16:34 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Mon, 20 Jan 2020 07:44:44 +0000 (16:44 +0900)
Change-Id: I01eb0052ab6dc1b41617c38f051515cd80198293
Signed-off-by: Seungho, Baek <sbsh.baek@samsung.com>
dali/internal/window-system/common/window-impl.cpp

index 7721cce..65420f1 100644 (file)
@@ -853,10 +853,14 @@ Dali::Window Window::Get( Dali::Actor actor )
   if ( Internal::Adaptor::Adaptor::IsAvailable() )
   {
     Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation( Internal::Adaptor::Adaptor::Get() );
-    windowImpl = static_cast<Internal::Adaptor::Window*>( adaptor.GetWindow( actor ) );
+    windowImpl = dynamic_cast<Internal::Adaptor::Window*>( adaptor.GetWindow( actor ) );
+    if( windowImpl )
+    {
+      return Dali::Window( windowImpl );
+    }
   }
 
-  return Dali::Window( windowImpl );
+  return Dali::Window();
 }
 
 void Window::SetParent( Dali::Window& parent )