Fix crash when receiving notifications