Skip to content

Commit

Permalink
fix(lines): fix NPE issue when lines series has no coordinate system, r…
Browse files Browse the repository at this point in the history
…esolves #14991.
  • Loading branch information
plainheart committed Dec 8, 2021
1 parent 2115f55 commit f9eff33
Show file tree
Hide file tree
Showing 3 changed files with 549 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/chart/helper/LineDraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function isPointNaN(pt: number[]) {
}

function lineNeedsDraw(pts: number[][]) {
return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);
return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);
}


Expand Down
5 changes: 4 additions & 1 deletion src/chart/lines/linesLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const linesLayout: StageHandler = {

reset: function (seriesModel: LinesSeriesModel) {
const coordSys = seriesModel.coordinateSystem;
if (!coordSys) {
return;
}
const isPolyline = seriesModel.get('polyline');
const isLarge = seriesModel.pipelineContext.large;
return {
Expand Down Expand Up @@ -96,4 +99,4 @@ const linesLayout: StageHandler = {
}
};

export default linesLayout;
export default linesLayout;
Loading

0 comments on commit f9eff33

Please sign in to comment.