mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Fix to make sure that attribute methods exists before calling. Check of hidpi attribute in canvas was crashing in Node.js, as the getAttribute method is undefined in node-canvas.
This commit is contained in:
parent
900cea3123
commit
3b22f185ce
1 changed files with 1 additions and 1 deletions
|
@ -219,7 +219,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
|||
function handleAttribute(name) {
|
||||
name += 'Attribute';
|
||||
return function(el, attr) {
|
||||
return el[name](attr) || el[name]('data-paper-' + attr);
|
||||
return el[name] && (el[name](attr) || el[name]('data-paper-' + attr));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue