From 25b4a87145b8a10c576621ab8f8807fd420cadb4 Mon Sep 17 00:00:00 2001 From: ljacobsson Date: Thu, 30 Jun 2022 15:53:03 +0200 Subject: [PATCH] fix: Null-value pattern bug #46 --- package.json | 2 +- src/commands/local/listeners/localPatternListener.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e483551..bdbfb98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mhlabs/evb-cli", - "version": "1.1.39", + "version": "1.1.40", "description": "A package for building EventBridge/CloudWatch Events patterns", "main": "index.js", "scripts": { diff --git a/src/commands/local/listeners/localPatternListener.js b/src/commands/local/listeners/localPatternListener.js index de1850e..e1050a9 100644 --- a/src/commands/local/listeners/localPatternListener.js +++ b/src/commands/local/listeners/localPatternListener.js @@ -21,9 +21,9 @@ const intrinsicFunctions = [ "Ref", ]; let output = console; -function findAllKeys(obj, keyArray) { - keyArray.push(...Object.keys(obj)); - for (const prop of Object.keys(obj)) { +function findAllKeys(obj, keyArray) { + keyArray.push(...Object.keys(obj || {})); + for (const prop of Object.keys(obj || {})) { if ( !obj[prop] || typeof obj[prop] !== "object" ||