@@ -8,6 +8,7 @@ Changelog
**Runtime**
* Core primitives now include UV, tangent and bitangent data
+* Fixed a crash when reloading lua scripts that haden't been loaded previously
* Fixed an issue that caused levels to be compiled successfully even when the units they depended on contained errors
* The Data Compiler now detects when files are deleted
@@ -122,6 +122,9 @@ void ResourceManager::reload(StringId64 type, StringId64 name)
const ResourceEntry& entry = hash_map::get(_rm, id, ResourceEntry::NOT_FOUND);
const u32 old_refs = entry.references;
+ if (entry == ResourceEntry::NOT_FOUND)
+ return;
+
unload(type, name);
load(type, name);
flush();