Skip to content

Commit

Permalink
fix desktop save file
Browse files Browse the repository at this point in the history
  • Loading branch information
HuixingWong committed Dec 31, 2021
1 parent b3aad7d commit ee8fe58
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ee8fe58

Please sign in to comment.