From 3d08221edf88a631bf4a21240a667460d860767d Mon Sep 17 00:00:00 2001
From: Thomas Oster <thomas.oster@rwth-aachen.de>
Date: Tue, 18 Sep 2012 19:24:14 +0200
Subject: [PATCH] Fix

---
 src/com/t_oster/liblasercut/VectorCommand.java | 1 +
 src/com/t_oster/liblasercut/VectorPart.java    | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/com/t_oster/liblasercut/VectorCommand.java b/src/com/t_oster/liblasercut/VectorCommand.java
index d1002cb..fbfe756 100644
--- a/src/com/t_oster/liblasercut/VectorCommand.java
+++ b/src/com/t_oster/liblasercut/VectorCommand.java
@@ -61,6 +61,7 @@ public class VectorCommand
   {
     if (type == CmdType.SETPROPERTY)
     {
+      this.type = type;
       this.property = p;
     }
     else
diff --git a/src/com/t_oster/liblasercut/VectorPart.java b/src/com/t_oster/liblasercut/VectorPart.java
index 5f536dc..136395a 100644
--- a/src/com/t_oster/liblasercut/VectorPart.java
+++ b/src/com/t_oster/liblasercut/VectorPart.java
@@ -41,8 +41,13 @@ public class VectorPart
 
   public VectorPart(LaserProperty initialProperty)
   {
+    if (initialProperty == null)
+    {
+      throw new IllegalArgumentException("Initial Property must not be null");
+    }
     commands = new LinkedList<VectorCommand>();
-    this.setProperty(initialProperty);
+    this.currentCuttingProperty = initialProperty;
+    commands.add(new VectorCommand(VectorCommand.CmdType.SETPROPERTY, initialProperty));
   }
 
   public LaserProperty getCurrentCuttingProperty()
-- 
GitLab