Skip to content

Commit 66ac221

Browse files
author
Rene Damm
authored
FIX: Exceptions in visualizers when controls are not present (#818).
1 parent 86b8cee commit 66ac221

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Assets/Samples/Visualizers/InputControlVisualizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ private static void OnEvent(InputEventPtr eventPtr, InputDevice device)
281281
for (var i = 0; i < s_EnabledInstances.Count; ++i)
282282
{
283283
var component = s_EnabledInstances[i];
284-
if (component.m_Control.device != device || component.m_Visualizer == null)
284+
if (component.m_Control?.device != device || component.m_Visualizer == null)
285285
continue;
286286

287287
component.OnEventImpl(eventPtr);

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ however, it has to be formatted properly to pass verification tests.
1111

1212
### Fixed
1313

14+
- Exceptions in scenes of `Visualizers` sample if respective device was not present on system (e.g. in `PenVisualizer` if no pen was present in system).
15+
1416
#### Actions
1517

1618
- Setting timeouts from `IInputInteraction.Process` not working as expected when processing happened in response to previous timeout expiring (#714).

0 commit comments

Comments
 (0)