Skip to content

Commit 498eb1a

Browse files
SamCYuSamChenYujfreire-unity
authored
FIX: Added checks to prevent NullReferenceException (#2364)
Co-authored-by: Sam Yu <sam.yu@sam.yu-70VM> Co-authored-by: João Freire <joao.freire@unity3d.com>
1 parent b4c80b6 commit 498eb1a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Fixed
1111

12+
- Fixed a `NullPointerReferenceException` thrown in `InputManagerStateMonitors.FireStateChangeNotifications` logging by adding validation [UUM-136095].
1213
- Fixed auto-save not working for Input System actions in Project Settings when both the Project Settings and Input System Actions windows were open [UUM-134035](https://jira.unity3d.com/browse/UUM-134035)
1314
- Improved New Input System warning dialog, Native Device Inputs Not Enabled [UUM-132151].
1415
- Fixed caching for InputControlPath display name [ISX-2501](https://jira.unity3d.com/browse/ISX-2501)

Packages/com.unity.inputsystem/InputSystem/InputManagerStateMonitors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ internal unsafe void FireStateChangeNotifications(int deviceIndex, double intern
397397
catch (Exception exception)
398398
{
399399
Debug.LogError(
400-
$"Exception '{exception.GetType().Name}' thrown from state change monitor '{listener.monitor.GetType().Name}' on '{listener.control}'");
400+
$"Exception '{exception.GetType().Name}' thrown from state change monitor '{(listener.monitor?.GetType().Name ?? "null")}' on '{(listener.control?.ToString() ?? "null")}'");
401401
Debug.LogException(exception);
402402
}
403403

0 commit comments

Comments
 (0)