Skip to content

Commit

Permalink
Fixed exception "Cannot read properties of null (reading 'plot')" (#7422
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bsekachev authored Feb 1, 2024
1 parent b539802 commit 27f8aa7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.d/20240201_123339_boris_fixed_exception_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Unhandled exception "Cannot read properties of null (reading 'plot')"
(<https://github.com/opencv/cvat/pull/7422>)
9 changes: 7 additions & 2 deletions cvat-canvas/src/typescript/sliceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,13 @@ export class SliceHandlerImpl implements SliceHandler {
return;
}

points.push([x, y]);
this.slicingLine.plot(stringifyPoints(points.flat()));
if (this.enabled) {
// check if slicing is still enabled
// because click() may finish slicing from inside
// e.g. when click out of contour with enabled shift
points.push([x, y]);
this.slicingLine.plot(stringifyPoints(points.flat()));
}
}
};

Expand Down

0 comments on commit 27f8aa7

Please sign in to comment.