Fix null values in entity getSQLProps()

Fixes 'null' role name when staff member has no hoisted roles
cshd
Dragory 2020-09-22 23:46:56 +03:00
parent 307b9fdee4
commit 8d151c1800
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class ThreadMessage {
getSQLProps() { getSQLProps() {
return Object.entries(this).reduce((obj, [key, value]) => { return Object.entries(this).reduce((obj, [key, value]) => {
if (typeof value === "function") return obj; if (typeof value === "function") return obj;
if (typeof value === "object") { if (typeof value === "object" && value != null) {
obj[key] = JSON.stringify(value); obj[key] = JSON.stringify(value);
} else { } else {
obj[key] = value; obj[key] = value;