Skip to content

Commit 98c846a

Browse files
authored
Merge pull request #10 from cap-js/missing-validations
Fix: Adding validations for properties
2 parents c3038fb + 74674cc commit 98c846a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cds-plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cds.once("served", async () => {
77
const production = profiles.includes('production');
88

99
// read notification types
10-
const notificationTypes = readFile(cds.env.requires.notifications.types);
10+
const notificationTypes = readFile(cds.env.requires?.notifications?.types);
1111

1212
if(validateNotificationTypes(notificationTypes)) {
1313
if (production) {

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function doesKeyExist(obj, key) {
4343
function readFile(filePath) {
4444
if(!existsSync(filePath)) {
4545
console.log(messages.TYPES_FILE_NOT_EXISTS);
46-
return {};
46+
return [];
4747
}
4848

4949
return JSON.parse(readFileSync(filePath));

0 commit comments

Comments
 (0)