From a5fd2df554d2d1e48b3b4d93399e8d494e4982f0 Mon Sep 17 00:00:00 2001 From: Syer10 Date: Mon, 2 Sep 2024 10:49:48 -0400 Subject: [PATCH] Fix Android build --- .../kotlin/ca/gosyer/jui/ui/base/file/AndroidFileChooser.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/presentation/src/androidMain/kotlin/ca/gosyer/jui/ui/base/file/AndroidFileChooser.kt b/presentation/src/androidMain/kotlin/ca/gosyer/jui/ui/base/file/AndroidFileChooser.kt index 10d106cbe9..12d182b367 100644 --- a/presentation/src/androidMain/kotlin/ca/gosyer/jui/ui/base/file/AndroidFileChooser.kt +++ b/presentation/src/androidMain/kotlin/ca/gosyer/jui/ui/base/file/AndroidFileChooser.kt @@ -21,7 +21,9 @@ actual class FileChooser( private val resultLauncher: ManagedActivityResultLauncher, ) { actual fun launch(extension: String) { - resultLauncher.launch(MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)) + val mime = MimeTypeMap.getSingleton() + .getMimeTypeFromExtension(extension) ?: return + resultLauncher.launch(mime) } }