Avoid NPE in AddSoyComment if no template file given

Change-Id: Ia7b8620599aa7c94d7f48ffde4b098cf85c42d0c
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyComment.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyComment.java
index bc8b9dc..60ce159 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyComment.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyComment.java
@@ -97,7 +97,7 @@
 
   private String buildComment(ActionRequest actionRequest, Map<String, String> properties) {
     String template = actionRequest.getParameter(1);
-    if (!template.isEmpty()) {
+    if (!Strings.isNullOrEmpty(template)) {
       return soyTextTemplate(SoyFileSet.builder(), template, properties);
     }
     logger.atSevere().log("No template name given in %s", actionRequest);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyCommentTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyCommentTest.java
index b5a1d17..8b9e974 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyCommentTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/AddSoyCommentTest.java
@@ -42,6 +42,16 @@
   private Path itsPath;
 
   @Test
+  public void testNoTemplateFileParameter() throws IOException {
+    ActionRequest actionRequest = new ActionRequest("foo");
+
+    AddSoyComment addSoyComment = createAddSoyComment();
+    addSoyComment.execute(its, "4711", actionRequest, ImmutableMap.of());
+
+    assertLogMessageContains("No template");
+  }
+
+  @Test
   public void testTemplateFileDoesNotExist() {
     ActionRequest actionRequest = new ActionRequest("foo nonExistingTemplate");