diff options
author | James Moger <james.moger@gitblit.com> | 2014-09-04 14:59:32 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-09-04 14:59:32 -0400 |
commit | 21fe98ebf8687f68cffbe6b6b8dec0073e93c541 (patch) | |
tree | 32bdf2a5143ec8a371e4c9933215c12b99b04e45 /src/main/java/com/gitblit/tickets | |
parent | 6b76d4fb30104f08a7c6b33d7cf05fb71179f6de (diff) | |
parent | 270e9e762820833d6815e362034dc3f4809b6470 (diff) | |
download | gitblit-21fe98ebf8687f68cffbe6b6b8dec0073e93c541.tar.gz gitblit-21fe98ebf8687f68cffbe6b6b8dec0073e93c541.zip |
Merge branch 'ticket/152' into develop
Diffstat (limited to 'src/main/java/com/gitblit/tickets')
-rw-r--r-- | src/main/java/com/gitblit/tickets/ITicketService.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/tickets/ITicketService.java b/src/main/java/com/gitblit/tickets/ITicketService.java index 7e7ea9e8..5e3e372a 100644 --- a/src/main/java/com/gitblit/tickets/ITicketService.java +++ b/src/main/java/com/gitblit/tickets/ITicketService.java @@ -673,21 +673,24 @@ public abstract class ITicketService implements IManager { Repository db = null; try { db = repositoryManager.getRepository(repository.name); - TicketMilestone milestone = getMilestone(repository, oldName); + TicketMilestone tm = getMilestone(repository, oldName); + if (tm == null) { + return false; + } StoredConfig config = db.getConfig(); config.unsetSection(MILESTONE, oldName); - config.setString(MILESTONE, newName, STATUS, milestone.status.name()); - config.setString(MILESTONE, newName, COLOR, milestone.color); - if (milestone.due != null) { + config.setString(MILESTONE, newName, STATUS, tm.status.name()); + config.setString(MILESTONE, newName, COLOR, tm.color); + if (tm.due != null) { config.setString(MILESTONE, newName, DUE, - new SimpleDateFormat(DUE_DATE_PATTERN).format(milestone.due)); + new SimpleDateFormat(DUE_DATE_PATTERN).format(tm.due)); } config.save(); milestonesCache.remove(repository.name); TicketNotifier notifier = createNotifier(); - for (QueryResult qr : milestone.tickets) { + for (QueryResult qr : tm.tickets) { Change change = new Change(createdBy); change.setField(Field.milestone, newName); TicketModel ticket = updateTicket(repository, qr.number, change); @@ -741,6 +744,9 @@ public abstract class ITicketService implements IManager { Repository db = null; try { TicketMilestone tm = getMilestone(repository, milestone); + if (tm == null) { + return false; + } db = repositoryManager.getRepository(repository.name); StoredConfig config = db.getConfig(); config.unsetSection(MILESTONE, milestone); |