Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

push_notifications: Guard reference to RemotePushDevice.

Anders Kaseorg88b9a2cfbd3e
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py
index b3658956149..eb3677bbe17 100644
--- a/zerver/lib/push_notifications.py
+++ b/zerver/lib/push_notifications.py
@@ -256,7 +256,7 @@ def get_info_from_apns_result(
logger.info(
"APNs: Removing invalid/expired token %s (%s)", device.token, result.description
)
- if isinstance(device, RemotePushDevice):
+ if settings.ZILENCER_ENABLED and isinstance(device, RemotePushDevice):
result_info.delete_device_id = device.device_id
else:
result_info.delete_device_token = device.token