Skip to content

Commit 68c125b

Browse files
committed
Merge pull request #112859 from wheatear-dev/bugfix-112855
Fix crash in `EditorFileDialog` by checking for null pointer
2 parents 4e8c4bc + 77318d2 commit 68c125b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

editor/gui/editor_file_dialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ void EditorFileDialog::_thumbnail_done(const String &p_path, const Ref<Texture2D
543543
}
544544

545545
void EditorFileDialog::_request_single_thumbnail(const String &p_path) {
546-
if (!FileAccess::exists(p_path) || !previews_enabled) {
546+
if (!FileAccess::exists(p_path) || !previews_enabled || !EditorResourcePreview::get_singleton()) {
547547
return;
548548
}
549549

@@ -1162,7 +1162,7 @@ void EditorFileDialog::update_file_list() {
11621162
d["path"] = file_info.path;
11631163
item_list->set_item_metadata(-1, d);
11641164

1165-
if (display_mode == DISPLAY_THUMBNAILS && previews_enabled) {
1165+
if (display_mode == DISPLAY_THUMBNAILS && previews_enabled && EditorResourcePreview::get_singleton()) {
11661166
EditorResourcePreview::get_singleton()->queue_resource_preview(file_info.path, callable_mp(this, &EditorFileDialog::_thumbnail_result));
11671167
}
11681168

0 commit comments

Comments
 (0)