From bce21ff9a90195c1b08fd0e814c8b7ed79ce41a8 Mon Sep 17 00:00:00 2001 From: Sofiya Tepikin Date: Sun, 24 Apr 2022 21:48:36 +0200 Subject: [PATCH] Fix when the object from db is empty --- db/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/index.js b/db/index.js index 26a746d..8e6d788 100644 --- a/db/index.js +++ b/db/index.js @@ -59,7 +59,7 @@ export function closeDb() { } function mapRealmObjToJsObj(realmObj) { - return JSON.parse(JSON.stringify(realmObj)) + return realmObj ? JSON.parse(JSON.stringify(realmObj)) : realmObj } export function getBleedingDaysSortedByDate() {