Skip to content

Commit

Permalink
fix: allow simple-json columns to hold non-object types (fixes typeor…
Browse files Browse the repository at this point in the history
  • Loading branch information
dapriett authored Jul 1, 2020
1 parent fc7a4f1 commit c42ac4d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/util/DateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,10 @@ export class DateUtils {

static stringToSimpleJson(value: any) {
try {
const simpleJSON = JSON.parse(value);
return (typeof simpleJSON === "object") ? simpleJSON : {};
} catch (err) {
return {};
}
return value ? JSON.parse(value) : null;
} catch (err) {
return null;
}
}

static simpleEnumToString(value: any) {
Expand Down

0 comments on commit c42ac4d

Please sign in to comment.