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

Commit a173385

Browse files
committed
Fix bug that makes system page unavailable when a stream is deleted
that was referenced by a stream processing disabled notification Fixes #835
1 parent 82bd053 commit a173385

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/models/Notification.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,15 @@ public NotificationType get() throws IOException, APIException {
8989
case OUTDATED_VERSION:
9090
return new OutdatedVersionNotification(this);
9191
case STREAM_PROCESSING_DISABLED:
92-
Stream stream = streamService.get(details.get("stream_id").toString());
92+
String streamTitle;
93+
try {
94+
final Stream stream = streamService.get(details.get("stream_id").toString());
95+
streamTitle = stream.getTitle();
96+
} catch (APIException | IOException e) {
97+
streamTitle = "(Stream title unavailable)";
98+
}
9399
long faultCount = Math.round((double)details.get("fault_count"));
94-
return new StreamProcessingDisabled(stream.getTitle(), faultCount);
100+
return new StreamProcessingDisabled(streamTitle, faultCount);
95101
}
96102

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

0 commit comments

Comments
 (0)