if obj is null or undefined, just return the map, no need to create a new object.

```js
if (!obj) {
  return map;
}
```