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

Commit

Permalink
fix(exceptions): avoid trying to load when not given a source
Browse files Browse the repository at this point in the history
  • Loading branch information
Merott committed Aug 8, 2016
1 parent 7128178 commit d18b3b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugin.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class PDFView extends common.PDFView {
}

public load(src: string) {
if (!src || !this.android) {
return;
}

// reset any previous promise since we've called load again
this.promise = void 0;

Expand Down
4 changes: 4 additions & 0 deletions src/plugin.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export class PDFView extends common.PDFView {
}

public load(src: string) {
if (!src) {
return;
}

let url: NSURL;

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

0 comments on commit d18b3b0

Please sign in to comment.