Add assert to ensure initialized variables. 32/110932/1
authorFrancisco Santos <f1.santos@samsung.com>
Wed, 18 Jan 2017 18:55:25 +0000 (18:55 +0000)
committerFrancisco Santos <f1.santos@samsung.com>
Wed, 18 Jan 2017 18:55:25 +0000 (18:55 +0000)
Change-Id: I46b75f9d7b6dd18aefebce845acbb7a46d258ffc

dali-toolkit/internal/image-loader/atlas-packer.cpp

index e02eba6..26ad3e0 100644 (file)
@@ -258,12 +258,11 @@ void AtlasPacker::GrowPack( SizeType blockWidth, SizeType blockHeight,
     firstFit = InsertNode( mRoot->child[1], blockWidth, blockHeight );
   }
 
-  if( firstFit != NULL )
-  {
-    firstFit->occupied = true;
-    packPositionX = firstFit->rectArea.x;
-    packPositionY = firstFit->rectArea.y;
-  }
+  DALI_ASSERT_ALWAYS( firstFit != NULL && "It should never happen!")
+
+  firstFit->occupied = true;
+  packPositionX = firstFit->rectArea.x;
+  packPositionY = firstFit->rectArea.y;
 }
 
 void AtlasPacker::GrowNode( SizeType blockWidth, SizeType blockHeight )