Android: Fix crash when no devices have outputs
Regression from 5171290bdb
.
This commit is contained in:
parent
cb71d84908
commit
7a4740adf7
|
@ -101,8 +101,8 @@ class AdvancedMappingDialog(
|
||||||
return
|
return
|
||||||
} else if (!isInput) {
|
} else if (!isInput) {
|
||||||
// Find the first device that has an output. (Most built-in devices don't have any)
|
// Find the first device that has an output. (Most built-in devices don't have any)
|
||||||
val deviceWithOutputs = devices.first { deviceHasOutputs(it) }
|
val deviceWithOutputs = devices.firstOrNull { deviceHasOutputs(it) }
|
||||||
if (deviceWithOutputs.isNotEmpty()) {
|
if (deviceWithOutputs != null) {
|
||||||
setSelectedDevice(deviceWithOutputs)
|
setSelectedDevice(deviceWithOutputs)
|
||||||
binding.dropdownDevice.setText(deviceWithOutputs, false)
|
binding.dropdownDevice.setText(deviceWithOutputs, false)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue