From eaf23c0f6bb97fdf16631296ab7016447a99c4f2 Mon Sep 17 00:00:00 2001
From: Carl Schwan <carl@carlschwan.eu>
Date: Fri, 29 Jan 2021 20:23:42 +0100
Subject: Don't die on broken olm account

---
 lib/crypto/qolmaccount.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'lib/crypto')

diff --git a/lib/crypto/qolmaccount.cpp b/lib/crypto/qolmaccount.cpp
index 3c1f4bd3..1de8a0dc 100644
--- a/lib/crypto/qolmaccount.cpp
+++ b/lib/crypto/qolmaccount.cpp
@@ -77,7 +77,10 @@ void QOlmAccount::unpickle(QByteArray &pickled, const PicklingMode &mode)
     const QByteArray key = toKey(mode);
     const auto error = olm_unpickle_account(m_account, key.data(), key.length(), pickled.data(), pickled.size());
     if (error == olm_error()) {
-        throw lastError(m_account);
+        qCWarning(E2EE) << "Failed to unpickle olm account";
+        //TODO: Do something that is not dying
+        // Probably log the user out since we have no way of getting to the keys
+        //throw lastError(m_account);
     }
 }
 
-- 
cgit v1.2.3