Skip to content

Commit db4169d

Browse files
authored
Fix timing problem in Chrome
1 parent 55dbb68 commit db4169d

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)