Skip to content

Commit

Permalink
GridSorter.parse() return null if called with null/undefined cfg (#3731)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryanseanlee authored Jul 23, 2024
1 parent dfaaf71 commit 18aeddf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmp/grid/GridSorter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright © 2024 Extremely Heavy Industries Inc.
*/
import {isNumber, isNil, isString} from 'lodash';
import {isNil, isNumber, isString} from 'lodash';

export type GridSorterLike = GridSorterSpec | string | GridSorter;

Expand All @@ -24,6 +24,7 @@ export class GridSorter {
* generated using GridSorter.toString().
*/
static parse(cfg: GridSorterLike) {
if (isNil(cfg)) return null;
if (cfg instanceof GridSorter) return cfg;
if (isString(cfg)) {
const [colId, sort, abs] = cfg.split('|').map(s => s.trim()) as any;
Expand Down

0 comments on commit 18aeddf

Please sign in to comment.