From 59d04b9c51f9467dc55ea41248570f7f4b979b64 Mon Sep 17 00:00:00 2001 From: danielpeintner Date: Tue, 12 Sep 2023 10:03:47 +0200 Subject: [PATCH] Update packages/td-tools/src/td-parser.ts Co-authored-by: Jan Romann --- packages/td-tools/src/td-parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/td-tools/src/td-parser.ts b/packages/td-tools/src/td-parser.ts index af3fc89e7..fe2f73293 100644 --- a/packages/td-tools/src/td-parser.ts +++ b/packages/td-tools/src/td-parser.ts @@ -222,7 +222,7 @@ export function serializeTD(thing: Thing): string { const copy = JSON.parse(JSON.stringify(thing)); // clean-ups - if (copy.security === undefined || copy.security.length === 0) { + if (copy?.security.length === 0) { copy.securityDefinitions = { nosec_sc: { scheme: "nosec" }, };