From 402a7e0094dbe69e294fee5e2e8677c84708d0e3 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 6 Jun 2020 16:51:16 +0200 Subject: [PATCH] Fix editor crash when mbedtls is disabled. (cherry picked from commit 054f52364fe3c204ca65fca905a5bb3261315e47) --- core/io/dtls_server.cpp | 5 ++++- core/io/packet_peer_dtls.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/io/dtls_server.cpp b/core/io/dtls_server.cpp index 07e6abb1c9d..aa960247ad7 100644 --- a/core/io/dtls_server.cpp +++ b/core/io/dtls_server.cpp @@ -37,7 +37,10 @@ bool DTLSServer::available = false; DTLSServer *DTLSServer::create() { - return _create(); + if (_create) { + return _create(); + } + return NULL; } bool DTLSServer::is_available() { diff --git a/core/io/packet_peer_dtls.cpp b/core/io/packet_peer_dtls.cpp index 01218a68815..67e6095c7f1 100644 --- a/core/io/packet_peer_dtls.cpp +++ b/core/io/packet_peer_dtls.cpp @@ -37,7 +37,10 @@ bool PacketPeerDTLS::available = false; PacketPeerDTLS *PacketPeerDTLS::create() { - return _create(); + if (_create) { + return _create(); + } + return NULL; } bool PacketPeerDTLS::is_available() {