Skip to content

Commit 047a524

Browse files
committed
fix: check if user provides settingPages, before translation them
1 parent 83040a3 commit 047a524

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adminforth/modules/restApi.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,11 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
416416
newMenu.forEach((menuItem) => {
417417
processItem(menuItem);
418418
});
419-
this.adminforth.config.auth.userMenuSettingsPages.forEach((page) => {
420-
processItem(page);
421-
});
419+
if( this.adminforth.config.auth.userMenuSettingsPages) {
420+
this.adminforth.config.auth.userMenuSettingsPages.forEach((page) => {
421+
processItem(page);
422+
});
423+
}
422424
await Promise.all(translateRoutines);
423425

424426
// strip all backendOnly fields or not described in adminForth fields from dbUser
@@ -1344,7 +1346,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
13441346
}
13451347
}
13461348
}
1347-
1349+
13481350
const { error } = await this.adminforth.updateResourceRecord({ resource, record, adminUser, oldRecord, recordId, extra: { body, query, headers, cookies, requestUrl} });
13491351
if (error) {
13501352
return { error };

0 commit comments

Comments
 (0)