Yea, we probably should throw IAE if the return string would be empty here.  We do it for most of the other conditions where the input string looks too wrong to continue processing, e.g. above you throw IAE if the input string was "".