sirWest / AudioSwitch

Switch between default audio input or output + change volume
Apache License 2.0
1.08k stars 87 forks source link

Exception when pressing a removed hotkey #125

Closed ExcuseMi closed 7 years ago

ExcuseMi commented 7 years ago

Scenario:

  1. Bind a function to Printscreen (or any other keys probably)
  2. Press apply hotkeys
  3. Go back and delete the entry from the hotkeys.
  4. Press apply
  5. Press printscreen

Expected: Printscreen hotkey doesn't trigger anything in AudioSwitch

Actual: An error is throw in AudioSwitch because the hotkey is still registered to the application.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate) at AudioSwitch.Forms.FormSwitcher.HotKeyPressed(Int16 id) at AudioSwitch.Forms.FormSwitcher.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

AudioSwitch Assembly Version: 2.1.7.0 Win32 Version: 2.1.7 CodeBase: file:///C:/Program%20Files%20(x86)/AudioSwitch/AudioSwitch.exe

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.6.1087.0 built by: NETFXREL4STAGE CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

** JIT Debugging ** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

ExcuseMi commented 7 years ago

Fixed in 2.1.8