Skip to content

Commit a83ea6b

Browse files
committed
Fix EditorFileSystem crash when fetching icons for unknown file types
Fixes crash reported in godotengine#97421 (comment).
1 parent a4c1804 commit a83ea6b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

editor/editor_file_system.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,10 @@ void EditorFileSystem::_update_file_icon_path(EditorFileSystemDirectory::FileInf
19781978
}
19791979

19801980
if (icon_path.is_empty() && !file_info->type.is_empty()) {
1981-
icon_path = EditorNode::get_singleton()->get_class_icon(file_info->type)->get_path();
1981+
Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(file_info->type);
1982+
if (icon.is_valid()) {
1983+
icon_path = icon->get_path();
1984+
}
19821985
}
19831986

19841987
file_info->icon_path = icon_path;

0 commit comments

Comments
 (0)