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);
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);
add(new Label("milestone"));\r
} else {\r
// link to milestone query\r
- TicketMilestone milestone = app().tickets().getMilestone(repository, ticket.milestone);\r
+ TicketMilestone tm = app().tickets().getMilestone(repository, ticket.milestone);\r
+ if (tm == null) {\r
+ tm = new TicketMilestone(ticket.milestone);\r
+ }\r
PageParameters milestoneParameters;\r
- if (milestone.isOpen()) {\r
+ if (tm.isOpen()) {\r
milestoneParameters = WicketUtils.newOpenTicketsParameter(repositoryName);\r
} else {\r
milestoneParameters = WicketUtils.newRepositoryParameter(repositoryName);\r
int progress = 0;\r
int open = 0;\r
int closed = 0;\r
- if (milestone != null) {\r
- progress = milestone.getProgress();\r
- open = milestone.getOpenTickets();\r
- closed = milestone.getClosedTickets();\r
+ if (tm != null) {\r
+ progress = tm.getProgress();\r
+ open = tm.getOpenTickets();\r
+ closed = tm.getClosedTickets();\r
}\r
\r
Fragment milestoneProgress = new Fragment("milestone", "milestoneProgressFragment", this);\r