diff --git a/api/api.cpp b/api/api.cpp index c9e69229..e70b8645 100644 --- a/api/api.cpp +++ b/api/api.cpp @@ -79,7 +79,8 @@ namespace api std::shared_ptr CreateStream (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote) { - auto leaseSet = i2p::data::netdb.FindLeaseSet (remote); + if (!dest) return nullptr; + auto leaseSet = dest->FindLeaseSet (remote); if (leaseSet) { auto stream = dest->CreateStream (*leaseSet);