Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
jobobby04 committed Dec 24, 2023
1 parent 66a14d9 commit c6e4410
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/exh/log/EnhancedFilePrinter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class EnhancedFilePrinter internal constructor(
writer.close()
}
cleanLogFilesIfNecessary()
if (writer.open(folder.createFile(newFileName)!!).not()) {
val file = folder.createFile(newFileName)
if (file == null || writer.open(file).not()) {
return
}
}
Expand Down

0 comments on commit c6e4410

Please sign in to comment.