diff --git a/common/src/desktopMain/kotlin/com/twidere/twiderex/kmp/FileResolver.kt b/common/src/desktopMain/kotlin/com/twidere/twiderex/kmp/FileResolver.kt index 506e8c7ab..3ba548cc9 100644 --- a/common/src/desktopMain/kotlin/com/twidere/twiderex/kmp/FileResolver.kt +++ b/common/src/desktopMain/kotlin/com/twidere/twiderex/kmp/FileResolver.kt @@ -44,7 +44,11 @@ actual class FileResolver { } actual fun openOutputStream(file: String): OutputStream? { - return File(file).takeIf { it.exists() && it.isFile }?.outputStream() + return File(file).apply { + if (!exists()) { + createNewFile() + } + }.takeIf { it.exists() && it.isFile }?.outputStream() } actual fun getMediaSize(file: String): MediaSize {