Fixes crash when using Resource::_take_over_path
This commit is contained in:
parent
371de5132c
commit
50c37ed986
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue