diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp
index fe15eedb27d2f8438007595b84d736fc2790af63..9d0a5ee683242e7b202de0db4cf4aa348ac69e7e 100644
--- a/src/jamidht/jamiaccount.cpp
+++ b/src/jamidht/jamiaccount.cpp
@@ -1129,7 +1129,9 @@ JamiAccount::loadAccount(const std::string& archive_password,
                     if (auto convModule = shared->convModule())
                         convModule->removeContact(uri, banned);
                     // Remove current connections with contact
-                    shared->connectionManager_->closeConnectionsWith(uri);
+                    if (shared->connectionManager_) {
+                        shared->connectionManager_->closeConnectionsWith(uri);
+                    }
                     // Update client.
                     emitSignal<DRing::ConfigurationSignal::ContactRemoved>(shared->getAccountID(),
                                                                            uri,