diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp
index d4fbb801c862816d16351900512373c4179dfd5d..0225ed27887c73ce1b2d85308b1dc1001dd7318e 100644
--- a/src/ChatPage.cpp
+++ b/src/ChatPage.cpp
@@ -616,6 +616,7 @@ ChatPage::handleSyncResponse(const mtx::responses::Sync &res, const std::string
         }
     } catch (const lmdb::error &e) {
         nhlog::db()->warn("Logged out in the mean time, dropping sync");
+        return;
     }
 
     nhlog::net()->debug("sync completed: {}", res.next_batch);