better error message if we can't find the update service

This commit is contained in:
geeksville
2020-07-04 11:32:51 -07:00
parent 92b3fa8d1f
commit f7ca63ed92

View File

@@ -268,7 +268,8 @@ class SoftwareUpdateService : JobIntentService(), Logging {
fun doUpdate(context: Context, sync: SafeBluetooth, assetName: String) {
try {
val g = sync.gatt!!
val service = g.services.find { it.uuid == SW_UPDATE_UUID }!!
val service = g.services.find { it.uuid == SW_UPDATE_UUID }
?: throw BLEException("Couldn't find update service")
info("Starting firmware update for $assetName")