瀏覽代碼

Fixed empty layers in .pixi file opening

flabbet 4 年之前
父節點
當前提交
323b4bb28f
共有 1 個文件被更改,包括 4 次插入1 次删除
  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)
         {
             WriteableBitmap bitmap = BitmapFactory.New(currentBitmapWidth, currentBitmapHeight);
-            bitmap.FromByteArray(byteArray);
+            if (byteArray != null)
+            {
+                bitmap.FromByteArray(byteArray);
+            }
             return bitmap;
         }