summary refs log tree commit diff
path: root/synapse/rest/admin/devices.py
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2021-12-13 15:39:43 +0000
committerGitHub <noreply@github.com>2021-12-13 15:39:43 +0000
commite5cdb9e2339e321e8a77a898d362d7fbc476303b (patch)
tree7ddb175af84267fd6e1cfb547346a7358a214fb5 /synapse/rest/admin/devices.py
parentAllow events to be created with no `prev_events` (MSC2716) (#11243) (diff)
downloadsynapse-e5cdb9e2339e321e8a77a898d362d7fbc476303b.tar.xz
Make `get_device` return None if the device doesn't exist rather than raising an exception. (#11565)
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
Diffstat (limited to 'synapse/rest/admin/devices.py')
-rw-r--r--synapse/rest/admin/devices.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/rest/admin/devices.py b/synapse/rest/admin/devices.py
index 062a33d28d..d9905ff560 100644
--- a/synapse/rest/admin/devices.py
+++ b/synapse/rest/admin/devices.py
@@ -63,6 +63,8 @@ class DeviceRestServlet(RestServlet):
         device = await self.device_handler.get_device(
             target_user.to_string(), device_id
         )
+        if device is None:
+            raise NotFoundError("No device found")
         return HTTPStatus.OK, device
 
     async def on_DELETE(