Browse Source

And make it not crash

Equbuxu 3 years ago
parent
commit
806888131d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      PixiEditor/Models/Controllers/ClipboardController.cs

+ 3 - 1
PixiEditor/Models/Controllers/ClipboardController.cs

@@ -40,7 +40,7 @@ namespace PixiEditor.Models.Controllers
                 document.LayerStructure,
                 document.Width,
                 document.Height,
-                document.ToSerializable());
+                null/*document.ToSerializable()*/);
         }
 
         private static Surface CreateMaskedCombinedSurface(Layer[] layers, LayerStructure structure, Layer selLayer)
@@ -63,6 +63,8 @@ namespace PixiEditor.Models.Controllers
         {
             if (!ClipboardHelper.TryClear())
                 return;
+            if (layers.Length == 0)
+                return;
 
             using Surface surface = CreateMaskedCombinedSurface(layers, structure, selLayer);
             DataObject data = new DataObject();