]> source.dussan.org Git - gitblit.git/commitdiff
Fix failure to clear/delete ticket topic and description 88/188/1
authorJames Moger <james.moger@gitblit.com>
Thu, 25 Sep 2014 14:20:03 +0000 (10:20 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 25 Sep 2014 14:20:03 +0000 (10:20 -0400)
src/main/java/com/gitblit/wicket/pages/EditTicketPage.java

index 1adc71364abdc988dfb482c69866c03af133a4d7..074ffa607cb8b56576d785de42cb1e0a914dddc4 100644 (file)
@@ -52,6 +52,7 @@ import com.gitblit.utils.StringUtils;
 import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.panels.MarkdownTextArea;\r
+import com.google.common.base.Optional;\r
 \r
 /**\r
  * Page for editing a ticket.\r
@@ -268,7 +269,7 @@ public class EditTicketPage extends RepositoryPage {
                                        change.setField(Field.title, title);\r
                                }\r
 \r
-                               String description = descriptionEditor.getText();\r
+                               String description = Optional.fromNullable(descriptionEditor.getText()).or("");\r
                                if ((StringUtils.isEmpty(ticket.body) && !StringUtils.isEmpty(description))\r
                                                || (!StringUtils.isEmpty(ticket.body) && !ticket.body.equals(description))) {\r
                                        // description change\r
@@ -287,9 +288,9 @@ public class EditTicketPage extends RepositoryPage {
                                        change.setField(Field.type, type);\r
                                }\r
 \r
-                               String topic = topicModel.getObject();\r
+                               String topic = Optional.fromNullable(topicModel.getObject()).or("");\r
                                if ((StringUtils.isEmpty(ticket.topic) && !StringUtils.isEmpty(topic))\r
-                                               || (!StringUtils.isEmpty(topic) && !topic.equals(ticket.topic))) {\r
+                                       || (!StringUtils.isEmpty(ticket.topic) && !ticket.topic.equals(topic))) {\r
                                        // topic change\r
                                        change.setField(Field.topic, topic);\r
                                }\r