Merge pull request #7299 from Snuffleupagus/PDFPageView_draw-zoomLayer-prevent-error
Prevent intermittent "Node was not found" errors when removing the `zoomLayer` in `PDFPageView_draw`
This commit is contained in:
commit
11914277d5
@ -443,7 +443,12 @@ var PDFPageView = (function PDFPageViewClosure() {
|
||||
zoomLayerCanvas.width = 0;
|
||||
zoomLayerCanvas.height = 0;
|
||||
|
||||
div.removeChild(self.zoomLayer);
|
||||
if (div.contains(self.zoomLayer)) {
|
||||
// Prevent "Node was not found" errors if the `zoomLayer` was
|
||||
// already removed. This may occur intermittently if the scale
|
||||
// changes many times in very quick succession.
|
||||
div.removeChild(self.zoomLayer);
|
||||
}
|
||||
self.zoomLayer = null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user