Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 5ea4ceb

Browse files
authored
Only check device if it exists (#2975)
Fixes a crash where if one of the controllers has not been used and is not part of the device table would cause a crash.
1 parent 6fd782c commit 5ea4ceb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/common/shared/org/mozilla/vrbrowser/input/MotionEventGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ private static boolean isOtherDeviceDown(int deviceId) {
155155
boolean result = false;
156156
for (int i=0; i<devices.size(); i++) {
157157
if (i != deviceId) {
158-
result |= devices.get(i).mTouchStartWidget != null;
158+
if (devices.get(i) != null) {
159+
result |= devices.get(i).mTouchStartWidget != null;
160+
}
159161
}
160162
}
161163

0 commit comments

Comments
 (0)