From 502b211840a1707d1141fb38493d4f79e94aec84 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 4 Aug 2022 05:11:46 -0500 Subject: [PATCH] Error checking --- scripts/client/utilities.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index adf038f7..05000645 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -48,7 +48,7 @@ function removeLocalPlayerFromVehicle() { function restoreLocalCamera() { logToConsole(LOG_DEBUG, `[VRR.Utilities] Camera restored`); - if (isCustomCameraSupported()) { + if (isGameFeatureSupported("customCamera")) { game.restoreCamera(true); } }; @@ -350,6 +350,10 @@ function setPlayerWeaponDamageEnabled(clientName, state) { function setLocalPlayerCash(amount) { logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`); + if (localPlayer == null) { + return false; + } + if (typeof localPlayer.money != "undefined") { localPlayer.money = toInteger(amount); }