From a89bab00c5d54fa6cdf2fbb31a784cb2cfbb48c9 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Wed, 15 May 2024 15:31:31 +0200 Subject: [PATCH] Clear the driver state only if the GamepadDriver isn't null --- src/Ryujinx.Input/HLE/NpadManager.cs | 2 +- src/Ryujinx.Input/IGamepadDriver.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs index 2409ecf22c..1bc54d6946 100644 --- a/src/Ryujinx.Input/HLE/NpadManager.cs +++ b/src/Ryujinx.Input/HLE/NpadManager.cs @@ -176,7 +176,7 @@ namespace Ryujinx.Input.HLE { foreach (InputConfig inputConfig in _inputConfig) { - _controllers[(int)inputConfig.PlayerIndex].GamepadDriver.Clear(); + _controllers[(int)inputConfig.PlayerIndex].GamepadDriver?.Clear(); } _blockInputUpdates = false; diff --git a/src/Ryujinx.Input/IGamepadDriver.cs b/src/Ryujinx.Input/IGamepadDriver.cs index ff4d36993c..625c3e6941 100644 --- a/src/Ryujinx.Input/IGamepadDriver.cs +++ b/src/Ryujinx.Input/IGamepadDriver.cs @@ -35,7 +35,7 @@ namespace Ryujinx.Input IGamepad GetGamepad(string id); /// - /// Flush the internal state of the driver. + /// Clear the internal state of the driver. /// /// Does nothing by default. void Clear() { }