Skip to content

Commit e54170b

Browse files
authored
Merge pull request #10190 from IgniteUI/rkaraivanov/summaries-setter
fix(grid): Check summary reference
2 parents 87b2061 + 1071e4e commit e54170b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

projects/igniteui-angular/src/lib/core/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ export const yieldingLoop = (count: number, chunkSize: number, callback: (index:
502502
chunk();
503503
};
504504

505+
export const isConstructor = (ref: any) => typeof ref === 'function' && Boolean(ref.prototype) && Boolean(ref.prototype.constructor);
506+
505507
export const reverseAnimationResolver = (animation: AnimationReferenceMetadata): AnimationReferenceMetadata =>
506508
oppositeAnimation.get(animation) ?? animation;
507509

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import { MRLResizeColumnInfo, MRLColumnSizeInfo, IColumnPipeArgs } from './inter
5151
import { DropPosition } from '../moving/moving.service';
5252
import { IgxColumnGroupComponent } from './column-group.component';
5353
import { IColumnVisibilityChangingEventArgs, IPinColumnCancellableEventArgs, IPinColumnEventArgs } from '../common/events';
54-
import { PlatformUtil } from '../../core/utils';
54+
import { isConstructor, PlatformUtil } from '../../core/utils';
5555
import { CellType } from '../common/cell.interface';
5656
import { IgxGridCell } from '../grid-public-cell';
5757

@@ -1011,7 +1011,9 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy {
10111011
* @memberof IgxColumnComponent
10121012
*/
10131013
public set summaries(classRef: any) {
1014-
this._summaries = new classRef();
1014+
if (isConstructor(classRef)) {
1015+
this._summaries = new classRef();
1016+
}
10151017

10161018
if (this.grid) {
10171019
this.grid.summaryService.removeSummariesCachePerColumn(this.field);

0 commit comments

Comments
 (0)