Skip to content

Commit bafc49d

Browse files
committed
safety for overwriting requires
1 parent 2cb19bf commit bafc49d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/plugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ const _overwriteAccessRoles = (envFeatureToggles) => {
6262
return;
6363
}
6464
cds.on("loaded", (csn) => {
65+
if (!csn.definitions[SERVICE_NAME]) {
66+
return;
67+
}
6568
for (const [access, endpoints] of Object.entries(SERVICE_ENDPOINTS)) {
6669
const accessRole = _getAccessRole(envFeatureToggles, access);
6770
if (accessRole) {

0 commit comments

Comments
 (0)