Fix editor crash when mbedtls is disabled.

This commit is contained in:
Fabio Alessandrelli 2020-06-06 16:51:16 +02:00
parent 17af010478
commit 054f52364f
2 changed files with 8 additions and 2 deletions

View file

@ -37,7 +37,10 @@ DTLSServer *(*DTLSServer::_create)() = nullptr;
bool DTLSServer::available = false; bool DTLSServer::available = false;
DTLSServer *DTLSServer::create() { DTLSServer *DTLSServer::create() {
return _create(); if (_create) {
return _create();
}
return nullptr;
} }
bool DTLSServer::is_available() { bool DTLSServer::is_available() {

View file

@ -36,7 +36,10 @@ PacketPeerDTLS *(*PacketPeerDTLS::_create)() = nullptr;
bool PacketPeerDTLS::available = false; bool PacketPeerDTLS::available = false;
PacketPeerDTLS *PacketPeerDTLS::create() { PacketPeerDTLS *PacketPeerDTLS::create() {
return _create(); if (_create) {
return _create();
}
return nullptr;
} }
bool PacketPeerDTLS::is_available() { bool PacketPeerDTLS::is_available() {