Merge pull request #14217 from Snuffleupagus/bug-1732141

[Firefox] Handle errors if loading failed before the "supportsRangedLoading" message was sent (bug 1732141)
This commit is contained in:
Brendan Dahl 2021-11-02 13:32:17 -07:00 committed by GitHub
commit 60ab751bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -332,6 +332,10 @@ class FirefoxExternalServices extends DefaultExternalServices {
}
switch (args.pdfjsLoadAction) {
case "supportsRangedLoading":
if (args.done && !args.data) {
callbacks.onError();
break;
}
pdfDataRangeTransport = new FirefoxComDataRangeTransport(
args.length,
args.data,
@ -359,9 +363,7 @@ class FirefoxExternalServices extends DefaultExternalServices {
pdfDataRangeTransport.onDataProgress(args.loaded, args.total);
break;
case "progressiveDone":
if (pdfDataRangeTransport) {
pdfDataRangeTransport.onDataProgressiveDone();
}
pdfDataRangeTransport?.onDataProgressiveDone();
break;
case "progress":
callbacks.onProgress(args.loaded, args.total);