Fix crash on editor without a feature profile

(cherry picked from commit f2a01b0c6b)
This commit is contained in:
coldragon 2020-07-07 17:00:14 +02:00 committed by Rémi Verschelde
parent 130ad08d47
commit a0f0aa1741

View file

@ -1126,7 +1126,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
// The 3D editor may be disabled as a feature, but scenes can still be opened. // The 3D editor may be disabled as a feature, but scenes can still be opened.
// This check prevents the preview from regenerating in case those scenes are then saved. // This check prevents the preview from regenerating in case those scenes are then saved.
Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile(); Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile();
if (!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D)) { if (profile.is_valid() && !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D)) {
img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data(); img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data();
} }
} }