diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-01-08 18:19:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 18:19:37 +0100 |
commit | fb31283960e0e62df6d7d23955b73d8140809ecb (patch) | |
tree | 810cad761913b7c33a3bac73edfdac5406910506 /core | |
parent | 98222130bfe5ec90c1030c2d1e4554e990c5e0f9 (diff) | |
parent | 97273ce37889d25a8959086fc0a46099d901b2fa (diff) |
Merge pull request #34915 from KoBeWi/404
Check if resource exists before loading
Diffstat (limited to 'core')
-rw-r--r-- | core/io/resource_loader.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 5d85634895..7471ab4241 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -277,6 +277,11 @@ RES ResourceLoader::_load(const String &p_path, const String &p_original_path, c ERR_FAIL_COND_V_MSG(found, RES(), "Failed loading resource: " + p_path + "."); +#ifdef TOOLS_ENABLED + FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES); + ERR_FAIL_COND_V_MSG(!file_check->file_exists(p_path), RES(), "Resource file not found: " + p_path + "."); +#endif + ERR_FAIL_V_MSG(RES(), "No loader found for resource: " + p_path + "."); } |