Skip to content

Commit

Permalink
Merge pull request #3744 from sul-dlss/nan-check
Browse files Browse the repository at this point in the history
Correctly check for NaN case
  • Loading branch information
cbeer authored Jan 17, 2024
2 parents 5db3a79 + 401acb3 commit fe0bd72
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/assets/javascripts/jquery.preview-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,14 @@
/ to have a bad time with an infinite while loop. This only manifests
/ on the show page when using the "back" button to get back to a show
/ page using the browse nearby feature.
/
/ Reproduction steps for NaN:
/ 1. visit https://searchworks.stanford.edu/view/2279186
/ 2. click on the bound-with link "Copy 1 bound with v. 5, no. 1. 36105026515499 (item id)"
/ 3. click the back button
/
*/
if ($itemsPerRow === NaN || $itemsPerRow === 0) {
if (Number.isNaN($itemsPerRow) || $itemsPerRow === 0) {
return;
}

Expand Down

0 comments on commit fe0bd72

Please sign in to comment.