From b360bdf978a65322886afd97c1abe9fb12f6ab99 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Tue, 30 Jul 2024 18:27:48 +0200 Subject: [PATCH] Add variantOf null check --- client/src/util.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/util.ts b/client/src/util.ts index 59b0c60..03c100b 100644 --- a/client/src/util.ts +++ b/client/src/util.ts @@ -16,6 +16,7 @@ export function isNullish(value: any) { } export function variantOf(enumValue: any) { + if (enumValue === null) return null; if (typeof enumValue === 'string') return enumValue; else return Object.entries(enumValue)[0][0]; }