Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue when getting an index that equals 0. #265

Merged
merged 2 commits into from
Oct 27, 2022

Conversation

gabriellebaudy
Copy link
Contributor

When using this method while being on the first image, the index returns 0, and this method would return undefined. This is unwanted since the first image obviously has a 0 index which is usable. My fix simply consists of ensuring the returned value is a number (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN).

When using this method while being on the first image, the index returns 0, and this method would return `undefined`.
This is unwanted since the first image obviously has a 0 index which is usable.
My fix simply consists of ensuring the returned value is a number (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN).
@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 6f2b5c4
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/63595a47e1ac8400087b23a0
😎 Deploy Preview https://deploy-preview-265--cornerstone-3d-docs.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 site settings.

@sedghi
Copy link
Member

sedghi commented Oct 27, 2022

Great catch, thanks for your contribution

@sedghi sedghi merged commit 30e4a5d into cornerstonejs:main Oct 27, 2022
@gabriellebaudy gabriellebaudy deleted the patch-1 branch October 27, 2022 07:42
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