summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-11-01 13:50:50 -0400
committerGitHub <noreply@github.com>2023-11-01 13:50:50 -0400
commit7b10ceda025c81171761b0de442f23030db6b95f (patch)
treeaced1419f58e63bebbcbf939b6929f827fa7b37d
parent48f913b6e7fdc83874d9ac7e5fb237cde85be5a2 (diff)
parent344162db75bffd0de9b43d18d2d789c1fd564e57 (diff)
Merge pull request #11940 from t895/controller-null-check
android: Default to player number 0 if we get an input from an unreco…
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
index fc6a8b5cb..47bde5081 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
@@ -68,7 +68,7 @@ object InputHandler {
private fun getPlayerNumber(index: Int, deviceId: Int = -1): Int {
var deviceIndex = index
if (deviceId != -1) {
- deviceIndex = controllerIds[deviceId]!!
+ deviceIndex = controllerIds[deviceId] ?: 0
}
// TODO: Joycons are handled as different controllers. Find a way to merge them.