I know this comes from my example, but it is horrible ;)
Those kind of checks should be in unit tests....