bug fix: handle undefined or null objects in .isObject() helper