Skip to content

Commit

Permalink
Fix crash in proofreading when no meshes existed before (#7534)
Browse files Browse the repository at this point in the history
* don't crash reducer when requestMesh action was received for not existent mesh

* update changelog
  • Loading branch information
philippotto authored Jan 9, 2024
1 parent 33abf96 commit 883f955
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed a race condition when opening a short link, that would sometimes lead to an error toast. [#7507](https://github.com/scalableminds/webknossos/pull/7507)
- Fixed that the Segment Statistics feature was not available in the context menu of segment groups and in the context menu of the data viewports. [#7510](https://github.com/scalableminds/webknossos/pull/7510)
- Fixed a bug where dataset managers were not allowed to assign teams to new datasets that they are only member of. This already worked while editing the dataset later, but not during upload. [#7518](https://github.com/scalableminds/webknossos/pull/7518)
- Fixed regression in proofreading tool when automatic mesh loading was disabled and a merge/split operation was performed. [#7534](https://github.com/scalableminds/webknossos/pull/7534)
- Fixed that last dimension value in ND dataset was not loaded. [#7535](https://github.com/scalableminds/webknossos/pull/7535)

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,8 @@ function AnnotationReducer(state: OxalisState, action: Action): OxalisState {
additionalCoordinates,
layerName,
);
if (maybeMeshes == null) {
throw Error("No mesh data found in state.localSegmentationData.");
}
if (maybeMeshes[segmentId] == null) {
if (maybeMeshes == null || maybeMeshes[segmentId] == null) {
// No meshes exist for the segment id. No need to do anything.
return state;
}
const { [segmentId]: _, ...remainingMeshes } = maybeMeshes as Record<number, MeshInformation>;
Expand Down

0 comments on commit 883f955

Please sign in to comment.