TextRange: handle an error case