Skip to content

Commit f16df40

Browse files
authored
Merge pull request #263 from NextNebula/fix-null-reference
Fix null reference timing problem in Chrome
2 parents 55dbb68 + db4169d commit f16df40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/ng2-pdfjs-viewer.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export class PdfJsViewerComponent implements OnInit, OnDestroy {
309309
if (this.externalWindow) {
310310
this.viewerTab.location.href = viewerUrl;
311311
} else {
312-
this.iframe.nativeElement.contentWindow.location.replace(viewerUrl);
312+
this.iframe.nativeElement.contentWindow ? this.iframe.nativeElement.contentWindow.location.replace(viewerUrl) : this.iframe.nativeElement.src = viewerUrl;
313313
}
314314

315315
// console.log(`

0 commit comments

Comments
 (0)