Skip to content

Commit

Permalink
Merge pull request #395 from TwidereProject/bugfix/desktop-file
Browse files Browse the repository at this point in the history
fix desktop save file
  • Loading branch information
probot-auto-merge[bot] authored Dec 31, 2021
2 parents b3aad7d + ee8fe58 commit 5d58192
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 5d58192

Please sign in to comment.