raise better error message for AttributeError's on null or undefined.