1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #8028 from Snuffleupagus/tests-prevent-console-errors

Prevent browser console errors during testing
This commit is contained in:
Tim van der Meij 2017-02-06 22:04:54 +01:00 committed by GitHub
commit ec26a7e565
4 changed files with 9 additions and 13 deletions

View file

@ -61,7 +61,10 @@ FontLoader.prototype = {
clear: function fontLoaderClear() {
var styleElement = this.styleElement;
if (styleElement) {
styleElement.parentNode.removeChild(styleElement);
if (styleElement.parentNode) {
// Prevent "TypeError: styleElement.parentNode is null" during testing.
styleElement.parentNode.removeChild(styleElement);
}
styleElement = this.styleElement = null;
}
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {