diff --git a/MFIGamepadFeeder/Gamepads/GamepadManager.cs b/MFIGamepadFeeder/Gamepads/GamepadManager.cs index d1fb7c2..fc55fd9 100644 --- a/MFIGamepadFeeder/Gamepads/GamepadManager.cs +++ b/MFIGamepadFeeder/Gamepads/GamepadManager.cs @@ -99,13 +99,16 @@ public void Refresh() public void SetupGamepad(HidDeviceRepresentation hidDeviceRepresentation, uint gamePadId, GamepadConfiguration config) { - var device = - _hidDeviceLoader.GetDevices( - hidDeviceRepresentation.VendorId, - hidDeviceRepresentation.ProductId, - hidDeviceRepresentation.ProductVersion, - hidDeviceRepresentation.SerialNumber - ).First(); + try + { + var device = + _hidDeviceLoader.GetDevices( + hidDeviceRepresentation.VendorId, + hidDeviceRepresentation.ProductId, + hidDeviceRepresentation.ProductVersion, + hidDeviceRepresentation.SerialNumber + ).First(); + if (device == null) { @@ -139,6 +142,11 @@ public void SetupGamepad(HidDeviceRepresentation hidDeviceRepresentation, uint g { continue; } + catch (Exception ex) + { + Log(ex.Message); + break; + } if (count > 0) { @@ -146,6 +154,11 @@ public void SetupGamepad(HidDeviceRepresentation hidDeviceRepresentation, uint g } } } + } + catch (Exception ex) + { + Log(ex.Message); + } } private async Task GetConfigFromFilePath(string filePath) diff --git a/MFIGamepadFeeder/Properties/AssemblyInfo.cs b/MFIGamepadFeeder/Properties/AssemblyInfo.cs index 843a28b..4d86bb7 100644 --- a/MFIGamepadFeeder/Properties/AssemblyInfo.cs +++ b/MFIGamepadFeeder/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")]