mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-02-01 19:33:28 -05:00
fix autobug - apparently EXTRA_DEVICE can be null on some implementations
This commit is contained in:
@@ -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