summaryrefslogtreecommitdiff
path: root/core/resource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/resource.cpp')
-rw-r--r--core/resource.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/resource.cpp b/core/resource.cpp
index 1c9d3f8d49..30e09716aa 100644
--- a/core/resource.cpp
+++ b/core/resource.cpp
@@ -68,7 +68,10 @@ void Resource::set_path(const String &p_path, bool p_take_over) {
if (p_take_over) {
ResourceCache::lock->write_lock();
- ResourceCache::resources.get(p_path)->set_name("");
+ Resource **res = ResourceCache::resources.getptr(p_path);
+ if (res) {
+ (*res)->set_name("");
+ }
ResourceCache::lock->write_unlock();
} else {
ResourceCache::lock->read_lock();