diff options
author | James Moger <james.moger@gitblit.com> | 2014-09-25 08:31:46 -0600 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-09-25 08:31:46 -0600 |
commit | fbe6dbd1e4c95b33fc21d8a7aaf17f181dacab48 (patch) | |
tree | 18a44160fdc60bcb7074dd5a8948ae38b874623a | |
parent | 54cc7d7c2483d7ca100a5db47f4e1e98bd97c7fe (diff) | |
parent | 388f49ada1b32bd2e99c964a0278094e4f21c3fb (diff) | |
download | gitblit-fbe6dbd1e4c95b33fc21d8a7aaf17f181dacab48.tar.gz gitblit-fbe6dbd1e4c95b33fc21d8a7aaf17f181dacab48.zip |
Merged #188 "Fix failure to clear/delete ticket topic and description"
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/EditTicketPage.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java index 1adc7136..074ffa60 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java @@ -52,6 +52,7 @@ import com.gitblit.utils.StringUtils; import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.panels.MarkdownTextArea;
+import com.google.common.base.Optional;
/**
* Page for editing a ticket.
@@ -268,7 +269,7 @@ public class EditTicketPage extends RepositoryPage { change.setField(Field.title, title);
}
- String description = descriptionEditor.getText();
+ String description = Optional.fromNullable(descriptionEditor.getText()).or("");
if ((StringUtils.isEmpty(ticket.body) && !StringUtils.isEmpty(description))
|| (!StringUtils.isEmpty(ticket.body) && !ticket.body.equals(description))) {
// description change
@@ -287,9 +288,9 @@ public class EditTicketPage extends RepositoryPage { change.setField(Field.type, type);
}
- String topic = topicModel.getObject();
+ String topic = Optional.fromNullable(topicModel.getObject()).or("");
if ((StringUtils.isEmpty(ticket.topic) && !StringUtils.isEmpty(topic))
- || (!StringUtils.isEmpty(topic) && !topic.equals(ticket.topic))) {
+ || (!StringUtils.isEmpty(ticket.topic) && !ticket.topic.equals(topic))) {
// topic change
change.setField(Field.topic, topic);
}
|