From 25d5390b5c9213128cd51404367da2bc98f0f6d9 Mon Sep 17 00:00:00 2001 From: danielpeintner Date: Wed, 20 Sep 2023 11:05:40 +0200 Subject: [PATCH] fix: wrong conversion --- 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 1311c776f..71c5fbfc9 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.length === 0) { + if (copy.security == null || copy.security.length === 0) { copy.securityDefinitions = { nosec_sc: { scheme: "nosec" }, };