diff --git a/README.md b/README.md index 57b443a..db31b95 100755 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ TODO - 0.4.0 - 0.4.1 - 0.4.2 + - 0.4.3 ## Installation root build.gradle @@ -46,7 +47,7 @@ allprojects { project build.gradle ```groovy dependencies { - commonMainApi("dev.icerock.moko:media:0.4.2") + commonMainApi("dev.icerock.moko:media:0.4.3") } ``` diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 90ee68a..3b47157 100755 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -5,7 +5,7 @@ object Versions { const val minSdk = 16 } - const val kotlin = "1.3.70" + const val kotlin = "1.3.71" object Plugins { const val kotlin = Versions.kotlin @@ -21,7 +21,7 @@ object Versions { object MultiPlatform { const val coroutines = "1.3.4" const val mokoPermissions = "0.5.0" - const val mokoMedia = "0.4.2" + const val mokoMedia = "0.4.3" } } } diff --git a/media/src/iosMain/kotlin/dev/icerock/moko/media/picker/MediaPickerController.kt b/media/src/iosMain/kotlin/dev/icerock/moko/media/picker/MediaPickerController.kt index 61aabec..55da0b3 100755 --- a/media/src/iosMain/kotlin/dev/icerock/moko/media/picker/MediaPickerController.kt +++ b/media/src/iosMain/kotlin/dev/icerock/moko/media/picker/MediaPickerController.kt @@ -33,6 +33,7 @@ import platform.UIKit.UIViewController import platform.darwin.NSObject import kotlin.coroutines.Continuation import kotlin.coroutines.suspendCoroutine +import kotlin.random.Random actual class MediaPickerController( val permissionsController: PermissionsController, @@ -130,14 +131,14 @@ actual class MediaPickerController( ) continuation.resumeWith(Result.success(media)) } else { - if (image == null || mediaUrl == null) { + if (image == null) { continuation.resumeWith(Result.failure(NoAccessToFileException("info: $info"))) // TODO write some info return } val media = Media( - name = mediaUrl.relativeString, - path = mediaUrl.path.orEmpty(), + name = mediaUrl?.relativeString ?: Random.nextLong().toString(), + path = mediaUrl?.path.orEmpty(), preview = Bitmap(image), type = type )