Skip to content

Conversation

Sofien-Sellami
Copy link
Contributor

Context

Sometimes, when switching hanging protocols, the activeViewport can be undefined.
This caused errors because the code assumed that an active viewport would always be present.

Changes & Results

Added a guard clause in _syncWithActiveViewport to safely handle case where:

  • activeViewport is undefined.
  • Ensures prefetching logic only runs when a valid viewport exists.

Before:

Changing hanging protocols could throw errors when no active viewport was set.

Before:

The app now gracefully skips syncing when there is no active viewport.

Testing

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS:
  • Node version:
  • Browser:

Copy link

netlify bot commented Sep 30, 2025

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit 1a05c98
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/68dbe19d4ce58e00089677a1
😎 Deploy Preview https://deploy-preview-5448--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

2 participants