Fix issue where pdfDocument is null

Happens when no file is loaded
This line can be simplified slightly (also the formatting isn't completely correct), please change it to:
```javaScript
if (!PDFView.pdfDocument) {
```
Once you've addressed this, please squash the commits: https://github.com/mozilla/pdf.js/wiki/Squashing-Commits.