Skip to content

Commit

Permalink
Fix check for missing key or value properties
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte authored and matz3 committed Sep 5, 2019
1 parent ada66e3 commit 23b0374
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class Framework {
this.logger.log("error", ErrorMessage.urlParameterNotObject(urlParameter));
throw new Error(ErrorMessage.failure());
}
if (!urlParameter.key || !urlParameter.value) {
if (urlParameter.key === undefined || urlParameter.value === undefined) {
this.logger.log("error", ErrorMessage.urlParameterMissingKeyOrValue(urlParameter));
throw new Error(ErrorMessage.failure());
}
Expand Down
7 changes: 7 additions & 0 deletions test/framework.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ describe("urlParameters", () => {
{
key: "test",
value: "🦆"
},
{
key: 0,
value: "🐴"
}
]
}
Expand All @@ -470,6 +474,9 @@ describe("urlParameters", () => {
expect(config.client.ui5.urlParameters).toStrictEqual([{
key: "test",
value: "🦆"
}, {
key: 0,
value: "🐴"
}]);
});
});
Expand Down

0 comments on commit 23b0374

Please sign in to comment.