diff --git a/MatrixSDK/NotificationCenter/Checker/MXPushRuleSenderNotificationPermissionConditionChecker.m b/MatrixSDK/NotificationCenter/Checker/MXPushRuleSenderNotificationPermissionConditionChecker.m index a4113b0697..622ea4e29c 100644 --- a/MatrixSDK/NotificationCenter/Checker/MXPushRuleSenderNotificationPermissionConditionChecker.m +++ b/MatrixSDK/NotificationCenter/Checker/MXPushRuleSenderNotificationPermissionConditionChecker.m @@ -51,15 +51,11 @@ - (BOOL)isCondition:(MXPushRuleCondition*)condition satisfiedBy:(MXEvent*)event MXJSONModelSetString(notifLevelKey, condition.parameters[@"key"]); if (notifLevelKey) { - MXRoom *room = [mxSession roomWithRoomId:event.roomId]; - if (room) - { - MXRoomPowerLevels *roomPowerLevels = roomState.powerLevels; - NSInteger notifLevel = [roomPowerLevels minimumPowerLevelForNotifications:notifLevelKey defaultPower:50]; - NSInteger senderPowerLevel = [roomPowerLevels powerLevelOfUserWithUserID:event.sender]; + MXRoomPowerLevels *roomPowerLevels = roomState.powerLevels; + NSInteger notifLevel = [roomPowerLevels minimumPowerLevelForNotifications:notifLevelKey defaultPower:50]; + NSInteger senderPowerLevel = [roomPowerLevels powerLevelOfUserWithUserID:event.sender]; - isSatisfied = (senderPowerLevel >= notifLevel); - } + isSatisfied = (senderPowerLevel >= notifLevel); } return isSatisfied;