From 3f0ef8e08f3c813ad4d3caf178262341d0ccad33 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 22 Apr 2021 19:19:17 +0200 Subject: [PATCH] Improve utils.getObjectProperty() --- lib/util/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/utils.js b/lib/util/utils.js index 9a0a35228..b071b35e8 100644 --- a/lib/util/utils.js +++ b/lib/util/utils.js @@ -126,7 +126,7 @@ function equalsPartial(object, expected) { } function getObjectProperty(object, key, defaultValue) { - return object.hasOwnProperty(key) ? object[key] : defaultValue; + return object && object.hasOwnProperty(key) ? object[key] : defaultValue; } function getResponse(request, data, error) {