Fix calls to ActivePads() causing exceptions in design mode.

master
Glenn Maynard 6 years ago
parent 5f627b1b55
commit a18df41e49
  1. 4
      smx-config/Helpers.cs

@ -25,6 +25,10 @@ namespace smx_config
// A shortcut for when a LoadFromConfigDelegateArgs isn't available: // A shortcut for when a LoadFromConfigDelegateArgs isn't available:
public static IEnumerable<Tuple<int, SMX.SMXConfig>> ActivePads() public static IEnumerable<Tuple<int, SMX.SMXConfig>> ActivePads()
{ {
// In case we're called in design mode, just return an empty list.
if(CurrentSMXDevice.singleton == null)
return new List<Tuple<int, SMX.SMXConfig>>();
return ActivePads(CurrentSMXDevice.singleton.GetState()); return ActivePads(CurrentSMXDevice.singleton.GetState());
} }

Loading…
Cancel
Save