Check if a texture is valid 00/232500/3
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 6 May 2020 04:52:04 +0000 (13:52 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 1 Jun 2020 09:14:47 +0000 (09:14 +0000)
Change-Id: Ia5541d3340435aa14b9254983ad42660bbb63f0f

dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/texture-manager-impl.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;
+      }
     }
   }
 
index 612433d..8912c17 100644 (file)
@@ -226,7 +226,6 @@ TextureSet TextureManager::LoadTexture(
     if( !data )
     {
       // use broken image
-      textureSet = TextureSet::New();
       Devel::PixelBuffer pixelBuffer = LoadImageFromFile( mBrokenImageUrl );
       if( pixelBuffer )
       {