Added null check for touchpad object

Related to issue #1145
This commit is contained in:
Travis Nickles 2020-03-12 21:22:17 -05:00
parent 56c4a1143e
commit c727dcc015

View File

@ -3889,9 +3889,9 @@ namespace DS4Windows
containsCustomAction[device] = HasCustomActions(device); containsCustomAction[device] = HasCustomActions(device);
containsCustomExtras[device] = HasCustomExtras(device); containsCustomExtras[device] = HasCustomExtras(device);
if (device < 4) if (device < 4 && control.touchPad[device] != null)
{ {
Program.rootHub.touchPad[device]?.ResetToggleGyroM(); control.touchPad[device]?.ResetToggleGyroM();
GyroOutMode currentGyro = gyroOutMode[device]; GyroOutMode currentGyro = gyroOutMode[device];
if (currentGyro == GyroOutMode.Mouse) if (currentGyro == GyroOutMode.Mouse)
{ {