[Swift-commit] r7302 - trunk/src/org/griphyn/vdl/karajan/lib
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Fri Nov 22 14:58:26 CST 2013
Author: hategan
Date: 2013-11-22 14:58:26 -0600 (Fri, 22 Nov 2013)
New Revision: 7302
Modified:
trunk/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java
Log:
better error message when empty profile is specified
Modified: trunk/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java 2013-11-21 22:54:29 UTC (rev 7301)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java 2013-11-22 20:58:26 UTC (rev 7302)
@@ -264,6 +264,9 @@
String key = attr(n, "key");
String value = text(n);
+ if (value == null) {
+ throw new IllegalArgumentException("No value for profile " + ns + ":" + key);
+ }
if (ns.equals("karajan")) {
bc.addProperty(key, value);
}
@@ -273,7 +276,12 @@
}
private String text(Node n) {
- return n.getFirstChild().getNodeValue();
+ if (n.getFirstChild() != null) {
+ return n.getFirstChild().getNodeValue();
+ }
+ else {
+ return null;
+ }
}
private String attr(Node n, String name) {
More information about the Swift-commit
mailing list