Skip to content

Commit

Permalink
Further ensure that PDFFindController._requestMatchesCount won't re…
Browse files Browse the repository at this point in the history
…turn broken data (PR 10052 follow-up)

This prevents the findbar from intermittently displaying `0 of {number} matches`, which *could* theoretically happen for large and/or slow loading documents.
  • Loading branch information
Snuffleupagus committed Sep 14, 2018
1 parent 0a0c38c commit 24cbae9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/pdf_find_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ class PDFFindController {
// When searching starts, this method may be called before the `pageMatches`
// have been counted (in `_calculateMatch`). Ensure that the UI won't show
// temporarily broken state when the active find result doesn't make sense.
if (current > total) {
if (current < 1 || current > total) {
current = total = 0;
}
return { current, total, };
Expand Down

0 comments on commit 24cbae9

Please sign in to comment.