fix for Cannot convert null to object at hasOwnProperty (native) when node is null