mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
accessing nodeType may throw an exception
This commit is contained in:
parent
217a75c0f6
commit
4f49bd6e9b
@ -156,7 +156,8 @@ html2canvas.Preload = function(element, opts){
|
||||
contentsLen = contents.length,
|
||||
background_image,
|
||||
src,
|
||||
img;
|
||||
img,
|
||||
elNodeType = false;
|
||||
|
||||
for (i = 0; i < contentsLen; i+=1 ){
|
||||
// var ignRe = new RegExp("("+this.ignoreElements+")");
|
||||
@ -166,8 +167,14 @@ html2canvas.Preload = function(element, opts){
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
if (el.nodeType === 1 || el.nodeType === undefined){
|
||||
try {
|
||||
elNodeType = el.nodeType;
|
||||
} catch (ex) {
|
||||
elNodeType = false;
|
||||
html2canvas.log("html2canvas: failed to access some element's nodeType - Exception: " + ex.message);
|
||||
}
|
||||
|
||||
if (elNodeType === 1 || elNodeType === undefined){
|
||||
|
||||
background_image = html2canvas.Util.getCSS(el, 'backgroundImage');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user