Fix crash in school info when dialer is unavailable (#1500)

This commit is contained in:
Rafał Borcz 2021-09-10 11:49:22 +02:00 committed by GitHub
parent e665a8f18b
commit 8528e0beff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,9 @@ fun Context.openNavigation(location: String) {
fun Context.openDialer(phone: String) {
val intentUri = Uri.parse("tel:$phone")
val intent = Intent(Intent.ACTION_DIAL, intentUri)
startActivity(intent)
if (intent.resolveActivity(packageManager) != null) {
startActivity(intent)
}
}
fun Context.shareText(text: String, subject: String?) {