BF: RoomViewController: Fixed crash reported by GA

This commit is contained in:
manuroe
2016-07-29 11:17:58 +02:00
parent 9325ee5a74
commit 764a299df1
+10 -2
View File
@@ -346,8 +346,16 @@
if ([AppDelegate theDelegate].visibleRoomId)
{
[AppDelegate theDelegate].visibleRoomId = nil;
[[AppDelegate theDelegate] removeObserver:self forKeyPath:@"isOffline"];
// Sanity check: Use a try..catch to prevent the app from crashing if there is no
// registered observer which happens if the provided self.roomDataSource is unexpectedly nil
@try
{
[[AppDelegate theDelegate] removeObserver:self forKeyPath:@"isOffline"];
}
@catch (id anException)
{
}
}
}