From a18df41e49ebfd4dc82e6569d82596aa7f31eea8 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 8 Nov 2018 19:11:51 -0600 Subject: [PATCH] Fix calls to ActivePads() causing exceptions in design mode. --- smx-config/Helpers.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smx-config/Helpers.cs b/smx-config/Helpers.cs index e36f1d9..c8810ec 100644 --- a/smx-config/Helpers.cs +++ b/smx-config/Helpers.cs @@ -25,6 +25,10 @@ namespace smx_config // A shortcut for when a LoadFromConfigDelegateArgs isn't available: public static IEnumerable> ActivePads() { + // In case we're called in design mode, just return an empty list. + if(CurrentSMXDevice.singleton == null) + return new List>(); + return ActivePads(CurrentSMXDevice.singleton.GetState()); }