I'd switch this to `if (!util.isPrimitive(er)) {`