Skip to content

Commit

Permalink
NXP-15213: fix NPE when serializing to json a document model with nul…
Browse files Browse the repository at this point in the history
…l ref
  • Loading branch information
Mariana Cedica committed Sep 12, 2014
1 parent 68c48e8 commit a6fbbd0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ public static void writeDocument(JsonGenerator jg, DocumentModel doc,
jg.writeStringField("uid", doc.getId());
jg.writeStringField("path", doc.getPathAsString());
jg.writeStringField("type", doc.getType());
jg.writeStringField("state", doc.getCurrentLifeCycleState());
jg.writeStringField("state",
doc.getRef() != null ? doc.getCurrentLifeCycleState() : null);
jg.writeStringField("versionLabel", doc.getVersionLabel());
jg.writeBooleanField("isCheckedOut", doc.isCheckedOut());
Lock lock = doc.getLockInfo();
Expand Down

0 comments on commit a6fbbd0

Please sign in to comment.