Browse Source

Nullability checks

Krzysztof Krysiński 1 week ago
parent
commit
3f2a28d4ed
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/PixiEditor/Views/Overlays/PathOverlay/VectorPathOverlay.cs

+ 4 - 4
src/PixiEditor/Views/Overlays/PathOverlay/VectorPathOverlay.cs

@@ -419,7 +419,7 @@ public class VectorPathOverlay : Overlay
         }
 
         Path = editableVectorPath.ToVectorPath();
-        AddToUndoCommand.Execute(Path);
+        AddToUndoCommand?.Execute(Path);
     }
 
     private void CreateHandle(int atIndex, bool isControlPoint = false)
@@ -529,7 +529,7 @@ public class VectorPathOverlay : Overlay
         if (IsOverPath(args.Point, out VecD closestPoint))
         {
             AddPointAt(closestPoint);
-            AddToUndoCommand.Execute(Path);
+            AddToUndoCommand?.Execute(Path);
             args.Handled = true;
         }
         else if (args.Modifiers == KeyModifiers.None)
@@ -541,7 +541,7 @@ public class VectorPathOverlay : Overlay
                 converted = false;
             }
 
-            AddToUndoCommand.Execute(Path);
+            AddToUndoCommand?.Execute(Path);
         }
     }
 
@@ -875,7 +875,7 @@ public class VectorPathOverlay : Overlay
 
     private void OnHandleRelease(Handle source, OverlayPointerArgs args)
     {
-        AddToUndoCommand.Execute(Path);
+        AddToUndoCommand?.Execute(Path);
 
         if (source is AnchorHandle anchorHandle)
         {