0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

fixed issue with extending null properties

This commit is contained in:
liabru 2014-03-19 12:49:48 +00:00
parent d54ccb90a6
commit 56768a4c9d

View file

@ -35,7 +35,7 @@ var Common = {};
if (source) { if (source) {
for (var prop in source) { for (var prop in source) {
if (deepClone && source[prop].constructor === Object) { if (deepClone && source[prop] && source[prop].constructor === Object) {
if (!obj[prop] || obj[prop].constructor === Object) { if (!obj[prop] || obj[prop].constructor === Object) {
obj[prop] = obj[prop] || {}; obj[prop] = obj[prop] || {};
Common.extend(obj[prop], deepClone, source[prop]); Common.extend(obj[prop], deepClone, source[prop]);