From 2670d849fbeeb9dfc5710b80e633ce103d3313e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Tue, 27 Jun 2023 11:42:13 -0400
Subject: [PATCH] misc: avoid nullptr exception

Change-Id: Ib75747a2c10ce191d005ca55a1f919423c4b1252
---
 src/jamidht/jamiaccount.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp
index 1fdf4a0794..08ca78a2c7 100644
--- a/src/jamidht/jamiaccount.cpp
+++ b/src/jamidht/jamiaccount.cpp
@@ -2152,7 +2152,8 @@ JamiAccount::convModule()
             [this](auto&& syncMsg) {
                 dht::ThreadPool::io().run([w = weak(), syncMsg] {
                     if (auto shared = w.lock())
-                        shared->syncModule()->syncWithConnected(syncMsg);
+                        if (auto sm = shared->syncModule())
+                            sm->syncWithConnected(syncMsg);
                 });
             },
             [this](auto&& uri, auto&& device, auto&& msg, auto token = 0) {
-- 
GitLab