0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-15 16:38:43 -05:00

nodejs compatibility

This commit is contained in:
Gilbert Röhrbein 2017-10-29 11:45:41 +01:00
parent 0895d81fa1
commit 43d8bf99ee

View file

@ -177,7 +177,11 @@ module.exports = Common;
* @return {boolean} True if the object is a HTMLElement, otherwise false
*/
Common.isElement = function(obj) {
return obj instanceof HTMLElement;
try {
return obj instanceof HTMLElement;
} catch(e) {
return false;
}
};
/**