Skip to content

Commit

Permalink
Merge pull request #33 from TelemetryDeck/fix-invalid-argument
Browse files Browse the repository at this point in the history
Fix possible crash when the cache directory doesn't exist
  • Loading branch information
kkostov authored Jul 16, 2024
2 parents 06e27d5 + 2a30464 commit 10f3a03
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class PersistentSignalCache(private var signalQueue: MutableList<Signal> = mutab
}

private fun saveSignals() {
// make sure the parent folder exists before writing
file?.parentFile?.mkdirs()
file?.createNewFile()
val json = Json.encodeToString(signalQueue)
file?.writeText(json)
Expand Down

0 comments on commit 10f3a03

Please sign in to comment.