diff --git a/dist/Whats New VASL674-beta1.pdf b/dist/Whats New VASL674-beta1.pdf index 9719c8c4f..3f5792af7 100644 Binary files a/dist/Whats New VASL674-beta1.pdf and b/dist/Whats New VASL674-beta1.pdf differ diff --git a/dist/buildFile b/dist/buildFile index e1c6fd854..39cacf6e1 100644 --- a/dist/buildFile +++ b/dist/buildFile @@ -1,5 +1,5 @@ - + diff --git a/dist/extensionsVersions.xml b/dist/extensionsVersions.xml index ae94b2b18..872731d2a 100644 --- a/dist/extensionsVersions.xml +++ b/dist/extensionsVersions.xml @@ -46,7 +46,7 @@ - + diff --git a/pom.xml b/pom.xml index 2cea3d446..2d67af043 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.vasl vasl - 6.7.4-beta1 + 6.7.4-beta2 jar diff --git a/src/VASL/build/module/ASLMap.java b/src/VASL/build/module/ASLMap.java index 67eac5d65..922f80db1 100644 --- a/src/VASL/build/module/ASLMap.java +++ b/src/VASL/build/module/ASLMap.java @@ -853,7 +853,7 @@ else if (b.getCropBounds().getX() != 0){ // board is cropped to half hex on lef // set crop variables int boardwidthinhexes = indexOfCol2 - indexOfCol1 + 1; mapheightinhexes = (int) Math.round(mapBoundary.height / b.getHexHeight()); - if (b.equals(boards.get(0))) { + if (!(boards.get(0) == null) && b.equals(boards.get(0))) { // error handling issue#2012 if (toplefthexwidth.contains("HalfHexWidthOffset")) { passA1centerx = b.getA1CenterX(); // board is not cropped on left edge and A1centerx will include offset } @@ -868,7 +868,7 @@ else if (toplefthexwidth.contains("HalfHexWidth")) { } } - if (b.equals(vaslboards.get(0))) { + if (!(!(vaslboards.get(0) == null)) && b.equals(vaslboards.get(0))) { // error handling issue#2012 if (toplefthexheight.contains("Offset")) { passA1centery = toplefthexheight.contains("HalfHeight") ? (b.getA1CenterY() - b.getHexHeight() /2) : b.getA1CenterY(); } else { @@ -2142,23 +2142,25 @@ public void drawPiecesInRegion(Graphics g, java.util.Map pieceMap = new HashMap(); for (int i = 0; i < stack.length; ++i) { // increment the count of pieces at this point - String name = stack[i].getName(); - Stack s = null; - if (stack[i] instanceof Stack) { - s = (Stack) stack[i]; - } else { - continue; - } - int x = s.getPieceCount(); - if (x == 0 || name.equals("")) - //empty stack, ignore - continue; - Point pt = stack[i].getPosition(); - Integer count = pieceMap.get(pt); - if (count == null) { - count = 0; + if (!(stack[i] == null)) { //error handling for NPE issue#2002 + String name = stack[i].getName(); + Stack s = null; + if (stack[i] instanceof Stack) { + s = (Stack) stack[i]; + } else { + continue; + } + int x = s.getPieceCount(); + if (x == 0 || name.equals("")) + //empty stack, ignore + continue; + Point pt = stack[i].getPosition(); + Integer count = pieceMap.get(pt); + if (count == null) { + count = 0; + } + pieceMap.put(pt, count + 1); } - pieceMap.put(pt, count + 1); } for (int i = 0; i < stack.length; ++i) { diff --git a/src/VASL/build/module/map/HIPFortification.java b/src/VASL/build/module/map/HIPFortification.java index 61c0477bb..4bb4edf5b 100644 --- a/src/VASL/build/module/map/HIPFortification.java +++ b/src/VASL/build/module/map/HIPFortification.java @@ -11,6 +11,7 @@ import VASSAL.build.Buildable; import VASSAL.build.GameModule; import VASSAL.build.module.GameComponent; +import VASSAL.build.module.GlobalOptions; import VASSAL.build.module.Map; import VASSAL.build.module.documentation.HelpFile; import VASSAL.build.module.map.Drawable; @@ -537,14 +538,25 @@ public Command decode(String s) { if (s.startsWith(COMMAND_PREFIX)) { // build the player object + boolean playerstringvalid = true; // error handling issue#2014 String[] strings = s.split(COMMAND_SEPARATOR); - HIPFortification.Player thePlayer = new HIPFortification.Player(strings[1], strings[2], strings[3]); + for (int i=1; i < 5; i++) { + if (i > strings.length) { + playerstringvalid = false; + } + } + if (playerstringvalid) { + HIPFortification.Player thePlayer = new HIPFortification.Player(strings[1], strings[2], strings[3]); - // add to the players list if necessary - if(!players.containsKey(thePlayer.getName())) { - players.put(thePlayer.getName(), thePlayer); + // add to the players list if necessary + if (!players.containsKey(thePlayer.getName())) { + players.put(thePlayer.getName(), thePlayer); + } + return new HIPFortification.HIPFortificationUpdateCommand(thePlayer); + } + else { + return null; } - return new HIPFortification.HIPFortificationUpdateCommand(thePlayer); } else if (s.startsWith(COMMAND_QUERY)){ List ownerlist = new List(); List querylist = new List(); List spotterlist = new List();