From 6df3621b472f7033de9d8391a2057a64aa5a42d6 Mon Sep 17 00:00:00 2001 From: Summersay415 Date: Wed, 14 Aug 2024 11:45:23 +0700 Subject: [PATCH] Return error when no ResourceFormatLoader found. --- core/io/resource_loader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 928bb95de3a..c1818ffd7b3 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -280,6 +280,10 @@ Ref ResourceLoader::_load(const String &p_path, const String &p_origin return res; } + if (r_error) { + *r_error = ERR_FILE_UNRECOGNIZED; + } + ERR_FAIL_COND_V_MSG(found, Ref(), vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path));