Skip to content

Commit

Permalink
better handlle unknown elements
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjacobsen committed Aug 17, 2024
1 parent 97f1c91 commit d1fbff2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/org/openlcb/cdi/jdom/JdomCdiRep.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public java.util.List<CdiRep.Item> getItems() {
case "action":
list.add(new ActionButtonRep(element));
break;
case "repname":
case "name":
case "description":
break;
Expand Down Expand Up @@ -467,7 +468,9 @@ public static class UnknownRep extends Item implements CdiRep.UnknownRep {
public int getSize() {
Attribute a = e.getAttribute("size");
try {
if (a == null) return 1;
// the `size` attribute is required to allocate space, so the
// default value set here is zero
if (a == null) return 0;
else return a.getIntValue();
} catch (org.jdom2.DataConversionException e1) { return 0; }
}
Expand Down

0 comments on commit d1fbff2

Please sign in to comment.