null check ig

idk why a required mod wouldn't be downloaded
This commit is contained in:
Noah Pilarski 2022-09-14 21:33:41 -04:00
parent 2e90c30287
commit 235f62ffc7

View File

@ -1,4 +1,5 @@
using NewHorizons.OtherMods.MenuFramework;
using Logger = NewHorizons.Utility.Logger;
namespace NewHorizons.OtherMods.CommonCameraUtility
{
@ -11,6 +12,16 @@ namespace NewHorizons.OtherMods.CommonCameraUtility
_cameraAPI = Main.Instance.ModHelper.Interaction.TryGetModApi<ICommonCameraAPI>("xen.CommonCameraUtility");
}
public static void RegisterCustomCamera(OWCamera camera) => _cameraAPI.RegisterCustomCamera(camera);
public static void RegisterCustomCamera(OWCamera camera)
{
if (_cameraAPI != null)
{
_cameraAPI.RegisterCustomCamera(camera);
}
else
{
Logger.LogError("Tried to register custom camera but Common Camera Utility was missing.");
}
}
}
}