diff --git a/lib/src/main/java/com/telemetrydeck/sdk/PersistentSignalCache.kt b/lib/src/main/java/com/telemetrydeck/sdk/PersistentSignalCache.kt index 54e904f..a445d91 100644 --- a/lib/src/main/java/com/telemetrydeck/sdk/PersistentSignalCache.kt +++ b/lib/src/main/java/com/telemetrydeck/sdk/PersistentSignalCache.kt @@ -56,6 +56,8 @@ class PersistentSignalCache(private var signalQueue: MutableList = 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)