Catch NPE

Fix #551, #549
This commit is contained in:
MM20 2023-10-13 15:11:26 +02:00
parent 0b5ba802db
commit 6d96d3ae8f
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -19,6 +19,7 @@ import de.mm20.launcher2.ktx.getSerialNumber
import de.mm20.launcher2.ktx.isAtLeastApiLevel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.lang.NullPointerException
/**
* Represents a modern (Android O+) launcher shortcut
@ -105,6 +106,9 @@ data class LauncherShortcut(
} catch (e: SecurityException) {
CrashReporter.logException(e)
null
} catch (e: NullPointerException) {
CrashReporter.logException(e)
null
}
} ?: return null
if (icon is AdaptiveIconDrawable) {