diff --git a/NewHorizons/OtherMods/CommonCameraUtility/CommonCameraHandler.cs b/NewHorizons/OtherMods/CommonCameraUtility/CommonCameraHandler.cs index 2aab1526..e344a57f 100644 --- a/NewHorizons/OtherMods/CommonCameraUtility/CommonCameraHandler.cs +++ b/NewHorizons/OtherMods/CommonCameraUtility/CommonCameraHandler.cs @@ -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("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."); + } + } } }