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:
Tim van der Meij 2016-05-09 22:16:09 +02:00
commit 11914277d5

View File

@ -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;
}