Check if a texture is valid
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / image / image-visual.cpp
index ea4aaa2..3d8456a 100644 (file)
@@ -507,9 +507,12 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize )
     if( textureSet )
     {
       auto texture = textureSet.GetTexture(0);
-      naturalSize.x = texture.GetWidth();
-      naturalSize.y = texture.GetHeight();
-      return;
+      if( texture )
+      {
+        naturalSize.x = texture.GetWidth();
+        naturalSize.y = texture.GetHeight();
+        return;
+      }
     }
   }