From b658e6824c49109108bb0721dfabd0ff4392a2ef Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Tue, 20 Jan 2026 18:12:48 -0300 Subject: [PATCH] Check if a resource from a snapshot exists before loading it --- modules/objectdb_profiler/editor/snapshot_data.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/objectdb_profiler/editor/snapshot_data.cpp b/modules/objectdb_profiler/editor/snapshot_data.cpp index 73479508fd..b29369d0e4 100644 --- a/modules/objectdb_profiler/editor/snapshot_data.cpp +++ b/modules/objectdb_profiler/editor/snapshot_data.cpp @@ -58,14 +58,18 @@ SnapshotDataObject::SnapshotDataObject(SceneDebuggerObject &p_obj, GameStateSnap // Built-in resource. String base_path = path.get_slice("::", 0); if (!resource_cache.cache.has(base_path)) { - resource_cache.cache[base_path] = ResourceLoader::load(base_path); + if (ResourceLoader::exists(path)) { + resource_cache.cache[base_path] = ResourceLoader::load(base_path); + } resource_cache.misses++; } else { resource_cache.hits++; } } if (!resource_cache.cache.has(path)) { - resource_cache.cache[path] = ResourceLoader::load(path); + if (ResourceLoader::exists(path)) { + resource_cache.cache[path] = ResourceLoader::load(path); + } resource_cache.misses++; } else { resource_cache.hits++;