currentError is invalid if undefined or null