Add some safety to object path requests

This commit is contained in:
Jarrod Doyle 2024-08-24 17:36:12 +01:00
parent 9fd76815a2
commit de4f3d6381
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 2 additions and 0 deletions

View File

@ -136,6 +136,7 @@ public class ResourcePathManager
{
if (!_initialised) return null;
objectName = objectName.ToLower();
if (_omResources.objectPathMap.TryGetValue(objectName, out var path))
{
return path;
@ -147,6 +148,7 @@ public class ResourcePathManager
{
if (!_initialised) return null;
objectName = objectName.ToLower();
if (_fmResources.TryGetValue(campaignName, out var campaign) &&
campaign.objectPathMap.TryGetValue(objectName, out var path))
{