@@ -74,7 +74,7 @@ export class GridMenuExtension implements Extension {
7474
7575 // merge original user grid menu items with internal items
7676 // then sort all Grid Menu Custom Items (sorted by pointer, no need to use the return)
77- const originalCustomItems = this . _userOriginalGridMenu . customItems || [ ] ;
77+ const originalCustomItems = Array . isArray ( this . _userOriginalGridMenu . customItems ) && this . _userOriginalGridMenu . customItems || [ ] ;
7878 this . sharedService . gridOptions . gridMenu . customItems = [ ...originalCustomItems , ...this . addGridMenuCustomCommands ( originalCustomItems ) ] ;
7979 this . extensionUtility . translateItems ( this . sharedService . gridOptions . gridMenu . customItems , 'titleKey' , 'title' ) ;
8080 this . extensionUtility . sortItems ( this . sharedService . gridOptions . gridMenu . customItems , 'positionOrder' ) ;
@@ -194,7 +194,7 @@ export class GridMenuExtension implements Extension {
194194
195195 // merge original user grid menu items with internal items
196196 // then sort all Grid Menu Custom Items (sorted by pointer, no need to use the return)
197- const originalCustomItems = this . _userOriginalGridMenu . customItems || [ ] ;
197+ const originalCustomItems = Array . isArray ( this . _userOriginalGridMenu . customItems ) && this . _userOriginalGridMenu . customItems || [ ] ;
198198 this . sharedService . gridOptions . gridMenu . customItems = [ ...originalCustomItems , ...this . addGridMenuCustomCommands ( originalCustomItems ) ] ;
199199 this . extensionUtility . translateItems ( this . sharedService . gridOptions . gridMenu . customItems , 'titleKey' , 'title' ) ;
200200 this . extensionUtility . sortItems ( this . sharedService . gridOptions . gridMenu . customItems , 'positionOrder' ) ;
@@ -222,9 +222,6 @@ export class GridMenuExtension implements Extension {
222222 private addGridMenuCustomCommands ( originalCustomItems : GridMenuItem [ ] ) {
223223 const backendApi = this . sharedService . gridOptions . backendServiceApi || null ;
224224 const gridMenuCustomItems : GridMenuItem [ ] = [ ] ;
225- if ( ! Array . isArray ( originalCustomItems ) ) {
226- originalCustomItems = [ ] ;
227- }
228225
229226 if ( this . sharedService . gridOptions && this . sharedService . gridOptions . enableFiltering ) {
230227 // show grid menu: clear all filters
0 commit comments