0
0
mirror of https://github.com/florisboard/florisboard.git synced 2024-09-19 19:42:20 +02:00

Fix null ptr exception in intent handling

This commit is contained in:
Patrick Goldinger 2024-08-10 02:47:09 +02:00
parent 6da6da74fc
commit 0450c8c7a1
No known key found for this signature in database

View File

@ -145,7 +145,7 @@ class FlorisAppActivity : ComponentActivity() {
super.onNewIntent(intent) super.onNewIntent(intent)
setIntent(intent) setIntent(intent)
if (intent?.action == Intent.ACTION_VIEW && intent.categories.contains(Intent.CATEGORY_BROWSABLE)) { if (intent?.action == Intent.ACTION_VIEW && intent.categories?.contains(Intent.CATEGORY_BROWSABLE) == true) {
intentToBeHandled = intent intentToBeHandled = intent
return return
} }
@ -195,7 +195,7 @@ class FlorisAppActivity : ComponentActivity() {
LaunchedEffect(intentToBeHandled) { LaunchedEffect(intentToBeHandled) {
val intent = intentToBeHandled val intent = intentToBeHandled
if (intent != null) { if (intent != null) {
if (intent.action == Intent.ACTION_VIEW && intent.categories.contains(Intent.CATEGORY_BROWSABLE)) { if (intent.action == Intent.ACTION_VIEW && intent.categories?.contains(Intent.CATEGORY_BROWSABLE) == true) {
navController.handleDeepLink(intent) navController.handleDeepLink(intent)
} else { } else {
val data = if (intent.action == Intent.ACTION_VIEW) { val data = if (intent.action == Intent.ACTION_VIEW) {