use ASSERT or REQUIRE for these type of checks.