summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-07-02 21:42:13 +0200
committerGitHub <noreply@github.com>2019-07-02 21:42:13 +0200
commit9e134407d485a3cbf8a9eb00b731ab63df5d9b9d (patch)
treeb3084bedbcfa98c4f60fa76758984b1d67ef650a
parente0d610203c5194400a5932f36ae0d96c8ede7f0f (diff)
parentc798173332ec2c622a5c00f1434b31cad6df8ece (diff)
Merge pull request #30252 from Faless/tls/disable_no_crash
Fix editor crash when StreamPeerSSL is unavilable.
-rw-r--r--core/io/stream_peer_ssl.cpp4
-rw-r--r--editor/editor_node.cpp10
2 files changed, 9 insertions, 5 deletions
diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp
index 254ae84bf5..ccce48ccd7 100644
--- a/core/io/stream_peer_ssl.cpp
+++ b/core/io/stream_peer_ssl.cpp
@@ -39,7 +39,9 @@ StreamPeerSSL *(*StreamPeerSSL::_create)() = NULL;
StreamPeerSSL *StreamPeerSSL::create() {
- return _create();
+ if (_create)
+ return _create();
+ return NULL;
}
StreamPeerSSL::LoadCertsFromMemory StreamPeerSSL::load_certs_func = NULL;
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 213327d8fd..d9600172d7 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -222,7 +222,7 @@ void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) {
_editor_select(EDITOR_SCRIPT);
} else if (ED_IS_SHORTCUT("editor/editor_help", p_event)) {
emit_signal("request_help_search", "");
- } else if (ED_IS_SHORTCUT("editor/editor_assetlib", p_event)) {
+ } else if (ED_IS_SHORTCUT("editor/editor_assetlib", p_event) && StreamPeerSSL::is_available()) {
_editor_select(EDITOR_ASSETLIB);
} else if (ED_IS_SHORTCUT("editor/editor_next", p_event)) {
_editor_select_next();
@@ -5090,10 +5090,11 @@ void EditorNode::_feature_profile_changed() {
main_editor_buttons[EDITOR_3D]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D));
main_editor_buttons[EDITOR_SCRIPT]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT));
- main_editor_buttons[EDITOR_ASSETLIB]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_ASSET_LIB));
+ if (StreamPeerSSL::is_available())
+ main_editor_buttons[EDITOR_ASSETLIB]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_ASSET_LIB));
if ((profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D) && singleton->main_editor_buttons[EDITOR_3D]->is_pressed()) ||
(profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT) && singleton->main_editor_buttons[EDITOR_SCRIPT]->is_pressed()) ||
- (profile->is_feature_disabled(EditorFeatureProfile::FEATURE_ASSET_LIB) && singleton->main_editor_buttons[EDITOR_ASSETLIB]->is_pressed())) {
+ (StreamPeerSSL::is_available() && profile->is_feature_disabled(EditorFeatureProfile::FEATURE_ASSET_LIB) && singleton->main_editor_buttons[EDITOR_ASSETLIB]->is_pressed())) {
_editor_select(EDITOR_2D);
}
} else {
@@ -5106,7 +5107,8 @@ void EditorNode::_feature_profile_changed() {
filesystem_dock->set_visible(true);
main_editor_buttons[EDITOR_3D]->set_visible(true);
main_editor_buttons[EDITOR_SCRIPT]->set_visible(true);
- main_editor_buttons[EDITOR_ASSETLIB]->set_visible(true);
+ if (StreamPeerSSL::is_available())
+ main_editor_buttons[EDITOR_ASSETLIB]->set_visible(true);
}
_update_dock_slots_visibility();