From 0253aa59c7826ba0b367ef7cca4dfda57d0e4b45 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 21 Jan 2023 20:06:57 -0800 Subject: [PATCH] Skip empty requests for cross-signing keys when user only has one device. Cause: Request button pressed in user settings. Result: Request body is jsNull; sendToDevice requires jsObject. --- src/encryption/Olm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/encryption/Olm.cpp b/src/encryption/Olm.cpp index f9f31fd5..b5576418 100644 --- a/src/encryption/Olm.cpp +++ b/src/encryption/Olm.cpp @@ -1613,6 +1613,9 @@ request_cross_signing_keys() body[local_user][dev] = secretRequest; } + if (body.empty()) + return; + http::client()->send_to_device( http::client()->generate_txn_id(), body,