From 8d151c1800fdb0857d5bed750cd0874f127df4fb Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 22 Sep 2020 23:46:56 +0300 Subject: [PATCH] Fix null values in entity getSQLProps() Fixes 'null' role name when staff member has no hoisted roles --- src/data/ThreadMessage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/ThreadMessage.js b/src/data/ThreadMessage.js index 70e1d21..b05f3d6 100644 --- a/src/data/ThreadMessage.js +++ b/src/data/ThreadMessage.js @@ -42,7 +42,7 @@ class ThreadMessage { getSQLProps() { return Object.entries(this).reduce((obj, [key, value]) => { if (typeof value === "function") return obj; - if (typeof value === "object") { + if (typeof value === "object" && value != null) { obj[key] = JSON.stringify(value); } else { obj[key] = value;