mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-10-06 02:21:20 -04:00
fix autobug - apparently EXTRA_DEVICE can be null on some implementations
This commit is contained in:
1 parent
d9a2a469bc
commit
091b18a5bb
1 file changed
+5
-3
@@ -489,9 +489,11 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||
}
|
||||
|
||||
UsbManager.ACTION_USB_DEVICE_ATTACHED -> {
|
||||
val device: UsbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE)!!
|
||||
debug("Handle USB device attached! $device")
|
||||
usbDevice = device
|
||||
val device: UsbDevice? = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE)
|
||||
if (device != null) {
|
||||
debug("Handle USB device attached! $device")
|
||||
usbDevice = device
|
||||
}
|
||||
}
|
||||
|
||||
Intent.ACTION_MAIN -> {
|
||||
|
||||
Reference in new issue
Block a user