From c26a0753fc53888851b966260f73abf53ebefe23 Mon Sep 17 00:00:00 2001 From: mcarare Date: Thu, 28 Apr 2022 12:46:27 +0300 Subject: [PATCH] [components] For https://github.com/mozilla-mobile/android-components/issues/9684: Return false instead of throwing NPE. --- .../main/java/mozilla/components/support/ktx/android/content/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/content/Context.kt b/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/content/Context.kt index 0c4fa60626aa..bd03b1c3b37c 100644 --- a/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/content/Context.kt +++ b/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/content/Context.kt @@ -264,7 +264,7 @@ fun Context.addContact( * (via https://stackoverflow.com/a/12362545/512580) */ inline val Context.isScreenReaderEnabled: Boolean - get() = getSystemService()!!.isTouchExplorationEnabled + get() = getSystemService()?.isTouchExplorationEnabled ?: false @VisibleForTesting internal var isMainProcess: Boolean? = null -- 2.11.4.GIT