Commit a0742a1c authored by rotn's avatar rotn
Browse files

Bugfix: NullPointerException when calling render() on root node. Call will now...

Bugfix: NullPointerException when calling render() on root node. Call will now be ignored  as there's no place to write the data to however it makes to call it anyway, to handle different Templates uniformly. Call to render(String sibling) will still throw NPE as root has no sibling and thus the expected behavior can't be fulfilled.

git-svn-id: https://svn.code.sf.net/p/snippetory/code/tags/snippetory-0.9.4.1@116 154fa62a-ae8f-480d-91fd-dc75d68c4636
parent 24f43ce4
......@@ -186,9 +186,15 @@ public class Region extends CharSequences implements Template, Cloneable {
@Override
public void render() {
// ignore render calls on root node as they don't make any sense.
if (isRoot()) return;
render(md.name);
}
private boolean isRoot() {
return getParent() == null;
}
@Override
public void render(String target) {
render(getParent(), target);
......
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