Skip to content

Commit

Permalink
fix: line data can be empty in QA (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
venikx authored May 30, 2023
1 parent b5cae59 commit 2aef4a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/quick-bags-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@equinor/esv-intersection': patch
---

If GeoModel lineData is empty, don't throw script error
7 changes: 4 additions & 3 deletions src/layers/GeomodelLayerV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ export class GeomodelLayerV2<T extends SurfaceData> extends PixiLayer<T> {

let penDown = false;
for (let i = 0; i < d.length; i++) {
if (d[i][1]) {
const lineData = d[i];
if (lineData && lineData[1] && lineData[0]) {
if (penDown) {
g.lineTo(d[i][0], d[i][1]);
g.lineTo(lineData[0], lineData[1]);
} else {
g.moveTo(d[i][0], d[i][1]);
g.moveTo(lineData[0], lineData[1]);
penDown = true;
}
} else {
Expand Down

0 comments on commit 2aef4a3

Please sign in to comment.