Skip to content

Commit a64eabd

Browse files
committed
be stricter at parsing jsons
1 parent 9bf1762 commit a64eabd

File tree

1 file changed

+1
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/notes/pro/extensions

1 file changed

+1
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/extensions/String.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fun String.parseChecklistItems(): ArrayList<ChecklistItem>? {
88
if (startsWith("[{") && endsWith("}]")) {
99
try {
1010
val checklistItemType = object : TypeToken<List<ChecklistItem>>() {}.type
11-
return Gson().fromJson<ArrayList<ChecklistItem>>(this, checklistItemType) ?: ArrayList(1)
11+
return Gson().fromJson<ArrayList<ChecklistItem>>(this, checklistItemType) ?: null
1212
} catch (e: Exception) {
1313
}
1414
}

0 commit comments

Comments
 (0)