From ea1dc82644e7030bd786997fe78b490c3241fcd7 Mon Sep 17 00:00:00 2001 From: danielpeintner Date: Tue, 12 Sep 2023 10:04:16 +0200 Subject: [PATCH] Update packages/td-tools/src/thing-model-helpers.ts Co-authored-by: Jan Romann --- packages/td-tools/src/thing-model-helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/td-tools/src/thing-model-helpers.ts b/packages/td-tools/src/thing-model-helpers.ts index 074b8944e..ecb434f2d 100644 --- a/packages/td-tools/src/thing-model-helpers.ts +++ b/packages/td-tools/src/thing-model-helpers.ts @@ -241,7 +241,7 @@ export class ThingModelHelpers { case "http": { return new Promise((resolve, reject) => { http.get(uri, (res) => { - if (res.statusCode === undefined || res.statusCode !== 200) { + if (res?.statusCode !== 200) { reject(new Error(`http status code not 200 but ${res.statusCode} for ${uri}`)); }