diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java index 9cca5102..06ed9647 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java @@ -91,17 +91,24 @@ public class FreemindExporter List relationships = mindmapMap.getRelationship(); for (RelationshipType relationship : relationships) { Node srcNode = nodesMap.get(relationship.getSrcTopicId()); - Arrowlink arrowlink = objectFactory.createArrowlink(); Node dstNode = nodesMap.get(relationship.getDestTopicId()); - arrowlink.setDESTINATION(dstNode.getID()); - if (relationship.isEndArrow() != null && relationship.isEndArrow()) - arrowlink.setENDARROW("Default"); - if (relationship.isStartArrow() != null && relationship.isStartArrow()) - arrowlink.setSTARTARROW("Default"); - List cloudOrEdge = srcNode.getArrowlinkOrCloudOrEdge(); - cloudOrEdge.add(arrowlink); + // Workaround for nodes without relationship associated ... + if (srcNode != null && dstNode != null) { + + Arrowlink arrowlink = objectFactory.createArrowlink(); + + arrowlink.setDESTINATION(dstNode.getID()); + if (relationship.isEndArrow() != null && relationship.isEndArrow()) + arrowlink.setENDARROW("Default"); + + if (relationship.isStartArrow() != null && relationship.isStartArrow()) + arrowlink.setSTARTARROW("Default"); + + List cloudOrEdge = srcNode.getArrowlinkOrCloudOrEdge(); + cloudOrEdge.add(arrowlink); + } } JAXBUtils.saveMap(freemindMap, outputStream); diff --git a/wise-webapp/src/test/resources/data/wisemaps/bug.mmr b/wise-webapp/src/test/resources/data/wisemaps/bug.mmr new file mode 100644 index 00000000..e69de29b diff --git a/wise-webapp/src/test/resources/data/wisemaps/bug.wxml b/wise-webapp/src/test/resources/data/wisemaps/bug.wxml new file mode 100644 index 00000000..871492a7 --- /dev/null +++ b/wise-webapp/src/test/resources/data/wisemaps/bug.wxml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file