Fix window cast crash issue 10/222810/1
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:58:40 +0000 (16:58 +0900)
Change-Id: I01eb0052ab6dc1b41617c38f051515cd80198293
Signed-off-by: Seungho, Baek <sbsh.baek@samsung.com>
dali/internal/window-system/common/window-impl.cpp

index 2fd7021..b505b22 100644 (file)
@@ -830,10 +830,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 )