Skip to content

Commit

Permalink
Wrap AppRecord parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sdercolin committed Jan 24, 2024
1 parent 72c9124 commit be164f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jvmMain/kotlin/com/sdercolin/vlabeler/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private fun SnackbarBox(state: AppState) {
@Composable
private fun rememberAppRecordStore(scope: CoroutineScope) = remember {
val recordText = AppRecordFile.takeIf { it.exists() }?.readText()
val appRecord = recordText?.parseJson() ?: AppRecord()
val appRecord = runCatching { recordText?.parseJson<AppRecord>() }.getOrNull() ?: AppRecord()
AppRecordStore(appRecord, scope)
}

Expand Down

0 comments on commit be164f4

Please sign in to comment.