From a64eabde8e56b12f198cbefb148c2bb30d4ec3a7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 19 Jan 2021 14:38:29 +0100 Subject: [PATCH] be stricter at parsing jsons --- .../kotlin/com/simplemobiletools/notes/pro/extensions/String.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/extensions/String.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/extensions/String.kt index a7be6176..5ecf3bf2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/extensions/String.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/extensions/String.kt @@ -8,7 +8,7 @@ fun String.parseChecklistItems(): ArrayList? { if (startsWith("[{") && endsWith("}]")) { try { val checklistItemType = object : TypeToken>() {}.type - return Gson().fromJson>(this, checklistItemType) ?: ArrayList(1) + return Gson().fromJson>(this, checklistItemType) ?: null } catch (e: Exception) { } }