From 39186e2f088d06cfb25b7ea89c54e55c7ed43a26 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 28 Feb 2024 21:55:13 -0600 Subject: [PATCH] Add null check --- package.json | 2 +- src/util.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f4b2de2..16b18d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cerc-io/laconic-sdk", - "version": "0.1.14", + "version": "0.1.15", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "git@github.com:cerc-io/laconic-sdk.git", diff --git a/src/util.ts b/src/util.ts index 222742d..e09aa77 100644 --- a/src/util.ts +++ b/src/util.ts @@ -86,6 +86,10 @@ export class Util { } static fromGQLValue(obj: any) { + if (null == obj) { + return null; + } + // Get first non-null key const present = Object.keys(obj).find(k => obj[k] !== null); if (present === undefined) {