Skip to content

Guard Crosshairs mouse move without annotations#2715

Open
nutzlastfan wants to merge 1 commit intocornerstonejs:mainfrom
nutzlastfan:codex/guard-crosshairs-missing-annotations
Open

Guard Crosshairs mouse move without annotations#2715
nutzlastfan wants to merge 1 commit intocornerstonejs:mainfrom
nutzlastfan:codex/guard-crosshairs-missing-annotations

Conversation

@nutzlastfan
Copy link
Copy Markdown

Summary

  • return early from CrosshairsTool.mouseMoveCallback when no filtered annotations are provided
  • avoid a follow-up Cannot read properties of undefined (reading 'length') crash during viewport/tool-state transitions

Context

We hit this when switching out of 2D MPR in an OHIF integration: the mouse move callback could be invoked while no filtered Crosshairs annotations were available yet.

Test

  • npx oxlint packages/tools/src/tools/CrosshairsTool.ts --quiet

The lint command completed with 0 errors; it reported 3 existing warnings in the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant