Browse Source

Fixed empty layers in .pixi file opening

flabbet 4 years ago
parent
commit
323b4bb28f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      PixiEditor/Models/ImageManipulation/BitmapUtils.cs

+ 4 - 1
PixiEditor/Models/ImageManipulation/BitmapUtils.cs

@@ -18,7 +18,10 @@ namespace PixiEditor.Models.ImageManipulation
         public static WriteableBitmap BytesToWriteableBitmap(int currentBitmapWidth, int currentBitmapHeight, byte[] byteArray)
         public static WriteableBitmap BytesToWriteableBitmap(int currentBitmapWidth, int currentBitmapHeight, byte[] byteArray)
         {
         {
             WriteableBitmap bitmap = BitmapFactory.New(currentBitmapWidth, currentBitmapHeight);
             WriteableBitmap bitmap = BitmapFactory.New(currentBitmapWidth, currentBitmapHeight);
-            bitmap.FromByteArray(byteArray);
+            if (byteArray != null)
+            {
+                bitmap.FromByteArray(byteArray);
+            }
             return bitmap;
             return bitmap;
         }
         }