From b77fd2336f3e7ad6a05e7d0a99095711d25854ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Mon, 28 Oct 2019 17:34:03 -0400
Subject: [PATCH] c wrapper: return null if no signer

---
 c/opendht.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c/opendht.cpp b/c/opendht.cpp
index 58a7db34..cfd05570 100644
--- a/c/opendht.cpp
+++ b/c/opendht.cpp
@@ -84,7 +84,7 @@ dht_value_id dht_value_get_id(const dht_value* data) {
 
 dht_publickey* dht_value_get_owner(const dht_value* data) {
     const ValueSp& vsp(*reinterpret_cast<const ValueSp*>(data));
-    return reinterpret_cast<dht_publickey*>(new PubkeySp(vsp->owner));
+    return vsp->owner ? reinterpret_cast<dht_publickey*>(new PubkeySp(vsp->owner)) : nullptr;
 }
 
 dht_infohash dht_value_get_recipient(const dht_value* data) {
-- 
GitLab