From 30c13905c0930f429ae87a16d01a451fc737f43a Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 27 Aug 2012 22:24:59 -0300 Subject: [PATCH] Fix NPE retriving history if the editor is null. --- .../java/com/wisemapping/rest/model/RestMindmapHistory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java index b2083164..f8422b84 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapHistory.java @@ -2,6 +2,7 @@ package com.wisemapping.rest.model; import com.wisemapping.model.MindMapHistory; +import com.wisemapping.model.User; import org.codehaus.jackson.annotate.JsonAutoDetect; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.jetbrains.annotations.NotNull; @@ -38,7 +39,8 @@ public class RestMindmapHistory { public RestMindmapHistory(@NotNull MindMapHistory history) { this.id = history.getId(); this.creation = history.getCreationTime(); - this.creator = history.getEditor().getFullName(); + final User editor = history.getEditor(); + this.creator = editor != null ? editor.getFullName() : ""; } public String getCreationTime() {