diff --git a/src/com/t_oster/liblasercut/VectorCommand.java b/src/com/t_oster/liblasercut/VectorCommand.java index d1002cb91bd09ead6286b48ffd7f13f9fbb36d4b..fbfe7564cec255b523ee14009ea990d13bed9581 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 5f536dc93c7bbf2395a003d95a859aba4dc42cf4..136395aaf883dec2c8fe1d9c3d40bf1b338106b0 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()