Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
Fix bug that makes system page unavailable when a stream is deleted
Browse files Browse the repository at this point in the history
that was referenced by a stream processing disabled notification

Fixes #835
  • Loading branch information
dennisoelkers committed Jul 18, 2014
1 parent 82bd053 commit a173385
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/models/Notification.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,15 @@ public NotificationType get() throws IOException, APIException {
case OUTDATED_VERSION:
return new OutdatedVersionNotification(this);
case STREAM_PROCESSING_DISABLED:
Stream stream = streamService.get(details.get("stream_id").toString());
String streamTitle;
try {
final Stream stream = streamService.get(details.get("stream_id").toString());
streamTitle = stream.getTitle();
} catch (APIException | IOException e) {
streamTitle = "(Stream title unavailable)";
}
long faultCount = Math.round((double)details.get("fault_count"));
return new StreamProcessingDisabled(stream.getTitle(), faultCount);
return new StreamProcessingDisabled(streamTitle, faultCount);
}

throw new RuntimeException("No notification registered for " + type);
Expand Down

0 comments on commit a173385

Please sign in to comment.