Handle null input in set wip/ready REST endpoints

PolyGerrit may send no input in the request body, while with the GWT UI
we normally get an empty input object.

Change-Id: Ie148961e68a41cad57574983d2a2e0c66ae6f170
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-05-10 14:49:20 +02:00
parent d1e0da8079
commit 41b77de568

View File

@@ -61,7 +61,7 @@ public class WorkInProgressOp implements BatchUpdateOp {
StringBuilder buf =
new StringBuilder(c.isWorkInProgress() ? "Set Work In Progress" : "Set Ready For Review");
String m = Strings.nullToEmpty(in.message).trim();
String m = in != null ? Strings.nullToEmpty(in.message).trim() : "";
if (!m.isEmpty()) {
buf.append("\n\n");
buf.append(m);