Commit 46e2d813 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '968-celld-upload-fails-without-notes' into 'master'

Resolve "CellD upload fails without NOTES"

Closes #968

See merge request minerva/core!984
parents dc2cc206 3f8c7057
......@@ -8,6 +8,7 @@ minerva (15.0.0~alpha.0) stable; urgency=medium
property defined (#806)
* Bug fix: position of structural state is preserved on upload CellDesigner
file (#671)
* Bug fix: problematic notes doesn't crash CellDesigner upload (#968)
minerva (14.0.3) stable; urgency=medium
* Bug fix: default zoom level on main map works even when x or y are
......
......@@ -337,7 +337,9 @@ public class RestAnnotationParser {
notes = XmlParser.nodeToString(node).trim();
} else {
Node bodyNode = XmlParser.getNode("body", htmlNode.getChildNodes());
notes = XmlParser.nodeToString(bodyNode).trim();
if (bodyNode != null) {
notes = XmlParser.nodeToString(bodyNode).trim();
}
}
if (notes.indexOf("</head>") >= 0) {
......
......@@ -274,6 +274,21 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
rap.getNotes(node);
}
@Test
public void testGetNotesWithMissingBody() throws Exception {
RestAnnotationParser rap = new RestAnnotationParser();
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <title/>\n" +
" </head>\n" +
" </html>\n" +
" </celldesigner:notes>");
String notes = rap.getNotes(node);
assertNotNull(notes);
}
@Test
public void testGetNotesWithLinkInside() throws Exception {
RestAnnotationParser rap = new RestAnnotationParser();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment