Skip to content
This repository was archived by the owner on Jun 15, 2024. It is now read-only.

Commit d18b3b0

Browse files
committed
fix(exceptions): avoid trying to load when not given a source
1 parent 7128178 commit d18b3b0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/plugin.android.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export class PDFView extends common.PDFView {
1818
}
1919

2020
public load(src: string) {
21+
if (!src || !this.android) {
22+
return;
23+
}
24+
2125
// reset any previous promise since we've called load again
2226
this.promise = void 0;
2327

src/plugin.ios.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export class PDFView extends common.PDFView {
2020
}
2121

2222
public load(src: string) {
23+
if (!src) {
24+
return;
25+
}
26+
2327
let url: NSURL;
2428

2529
if (src.indexOf('://') === -1) {

0 commit comments

Comments
 (0)