From 3911ebb819cf4c3f1214be183066eefed97db7dc Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 14 Nov 2021 01:09:46 +0700 Subject: [PATCH] Fix possible access to `none` --- sources/Data/Database/Local/LocalDatabaseInstance.uc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/Data/Database/Local/LocalDatabaseInstance.uc b/sources/Data/Database/Local/LocalDatabaseInstance.uc index bc8b704..7714efc 100644 --- a/sources/Data/Database/Local/LocalDatabaseInstance.uc +++ b/sources/Data/Database/Local/LocalDatabaseInstance.uc @@ -222,7 +222,8 @@ public function DBWriteTask WriteData(JSONPointer pointer, AcediaObject data) if (!ValidatePointer(pointer, writeTask)) return writeTask; if (!ValidateRootRecord(writeTask)) return writeTask; - if (pointer.GetLength() <= 0) { + // We can only write JSON array as the root value + if (data != none && pointer.GetLength() <= 0) { isDataStorable = (data.class == class'AssociativeArray'); } else {