From 1b28eca50e34f8e44704d9e41bc2bde208e529ed Mon Sep 17 00:00:00 2001 From: Sven Jacobs Date: Sat, 21 Sep 2024 16:57:19 +0200 Subject: [PATCH] fix: don't crash if no custom tabs client was found --- app/src/main/kotlin/com/svenjacobs/app/leon/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/svenjacobs/app/leon/MainActivity.kt b/app/src/main/kotlin/com/svenjacobs/app/leon/MainActivity.kt index 2af1f243..53f07f27 100644 --- a/app/src/main/kotlin/com/svenjacobs/app/leon/MainActivity.kt +++ b/app/src/main/kotlin/com/svenjacobs/app/leon/MainActivity.kt @@ -105,7 +105,9 @@ class MainActivity : ComponentActivity() { } val packageName = CustomTabsClient.getPackageName(this, null) - CustomTabsClient.bindCustomTabsService(this, packageName, connection) + if (packageName != null) { + CustomTabsClient.bindCustomTabsService(this, packageName, connection) + } customTabsInitialized = true }