--- src/org/jgrapht/ext/DOTExporter.java 2010-11-27 23:36:27.000000000 -0600 +++ DOTExporter.java 2011-12-07 21:06:03.041369519 -0600 @@ -152,7 +152,7 @@ if (vertexLabelProvider != null) { labelName = vertexLabelProvider.getVertexName(v); } - Map attributes = null; + Map attributes = new HashMap();; if (vertexAttributeProvider != null) { attributes = vertexAttributeProvider.getComponentAttributes(v); } @@ -200,14 +200,16 @@ if (labelName != null) { out.print("label=\"" + labelName + "\" "); } - for (Map.Entry entry : attributes.entrySet()) { - String name = entry.getKey(); - if (name.equals("label")) { - // already handled by special case above - continue; - } - out.print(name + "=\"" + entry.getValue() + "\" "); - } + if (attributes != null) { + for (Map.Entry entry : attributes.entrySet()) { + String name = entry.getKey(); + if (name.equals("label")) { + // already handled by special case above + continue; + } + out.print(name + "=\"" + entry.getValue() + "\" "); + } + } out.print("]"); }