[DS-1065] Don't dereference a missing 'id' attribute; leave authority null

This commit is contained in:
Mark H. Wood
2012-06-29 13:23:05 -04:00
parent c9820a3bbd
commit 818d7c48c5

View File

@@ -190,7 +190,9 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
{
values[i] = node.getAttributes().getNamedItem("label").getNodeValue();
}
authorities[i] = node.getAttributes().getNamedItem("id").getNodeValue();
Node idAttr = node.getAttributes().getNamedItem("id");
if (null != idAttr) // 'id' is optional
authorities[i] = idAttr.getNodeValue();
}
int resultCount = Math.min(labels.length - start, limit);
choices = new Choice[resultCount];