]> source.dussan.org Git - gitblit.git/commitdiff
Fix NPE in the Edit Ticket page
authorJames Moger <james.moger@gitblit.com>
Fri, 7 Mar 2014 17:23:23 +0000 (12:23 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 7 Mar 2014 17:23:23 +0000 (12:23 -0500)
src/main/java/com/gitblit/wicket/pages/EditTicketPage.java

index 5fa31975f16b815d3b8707cf1d8aa33fcb01fc27..ac7595893b4e841c5c16a148a47aa19d40008d4f 100644 (file)
@@ -134,13 +134,14 @@ public class EditTicketPage extends RepositoryPage {
                                Change change = new Change(createdBy);\r
 \r
                                String title = titleModel.getObject();\r
-                               if (!ticket.title.equals(title)) {\r
+                               if (!StringUtils.isEmpty(title) && !ticket.title.equals(title)) {\r
                                        // title change\r
                                        change.setField(Field.title, title);\r
                                }\r
 \r
                                String description = descriptionEditor.getText();\r
-                               if (!ticket.body.equals(description)) {\r
+                               if ((StringUtils.isEmpty(ticket.body) && !StringUtils.isEmpty(description))\r
+                                               || (!StringUtils.isEmpty(ticket.body) && !ticket.body.equals(description))) {\r
                                        // description change\r
                                        change.setField(Field.body, description);\r
                                }\r