Skip to content

Commit

Permalink
Prevent if (!state || false) { in the output, in `PDFHistory._popSt…
Browse files Browse the repository at this point in the history
…ate`, for e.g. MOZCENTRAL builds

By re-ordering the condition, which includes a `PDFJSDev` check, we can avoid meaningless output in the built files.
  • Loading branch information
Snuffleupagus committed Dec 13, 2019
1 parent c5f2f87 commit 1fab637
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/pdf_history.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ class PDFHistory {
let newHash = getCurrentHash(), hashChanged = this._currentHash !== newHash;
this._currentHash = newHash;

if (!state ||
(typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
state.chromecomState && !this._isValidState(state))) {
if ((typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
state && state.chromecomState && !this._isValidState(state)) ||
!state) {
// This case corresponds to the user changing the hash of the document.
this._uid++;

Expand Down

0 comments on commit 1fab637

Please sign in to comment.