Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes error thrown when clicking on a json file in the file dock
  • Loading branch information
DrewV3 committed Oct 22, 2022
1 parent 276ab5b commit b99e4e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,11 +1244,12 @@ Error EditorNode::load_resource(const String &p_resource, bool p_ignore_broken_d
Error err;

Ref<Resource> res;
if (ResourceLoader::exists(p_resource, "")) {
res = ResourceLoader::load(p_resource, "", ResourceFormatLoader::CACHE_MODE_REUSE, &err);
} else if (textfile_extensions.has(p_resource.get_extension())) {
if (textfile_extensions.has(p_resource.get_extension())) {
res = ScriptEditor::get_singleton()->open_file(p_resource);
}
else if (ResourceLoader::exists(p_resource, "")) {
res = ResourceLoader::load(p_resource, "", ResourceFormatLoader::CACHE_MODE_REUSE, &err);
}
ERR_FAIL_COND_V(!res.is_valid(), ERR_CANT_OPEN);

if (!p_ignore_broken_deps && dependency_errors.has(p_resource)) {
Expand Down

0 comments on commit b99e4e7

Please sign in to comment.