From 9d8eedd5813aaedefb8dbf23c6ab591073dbcff1 Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Tue, 8 Dec 2020 12:05:37 +0100 Subject: [PATCH] =?UTF-8?q?alterNERDtive-base:=20added=20some=20parameter?= =?UTF-8?q?=20checking=20for=20contexts=20that=20didn=E2=80=99t=20have=20i?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/VoiceAttack-base/base.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/VoiceAttack-base/base.cs b/plugins/VoiceAttack-base/base.cs index 0d5bac9..8961a7d 100644 --- a/plugins/VoiceAttack-base/base.cs +++ b/plugins/VoiceAttack-base/base.cs @@ -66,7 +66,7 @@ namespace alterNERDtive private static void Context_Config_SetVariables(dynamic vaProxy) { - string trigger = vaProxy.GetText("~trigger"); + string trigger = vaProxy.GetText("~trigger") ?? throw new ArgumentNullException("~trigger"); Log.Debug($"Loading variables for trigger '{trigger}' …"); Config.SetVariablesForTrigger(vaProxy, trigger); } @@ -166,8 +166,8 @@ namespace alterNERDtive private static void Context_DistanceBetween(dynamic vaProxy) { - string fromSystem = vaProxy.GetText("~fromSystem"); - string toSystem = vaProxy.GetText("~toSystem"); + string fromSystem = vaProxy.GetText("~fromSystem") ?? throw new ArgumentNullException("~fromSystem"); + string toSystem = vaProxy.GetText("~toSystem") ?? throw new ArgumentNullException("~toSystem"); int roundTo = vaProxy.GetInt("~roundTo") ?? 2; string path = $"{vaProxy.GetText("Python.ScriptPath")}\\explorationtools.exe";