term_exists returns NULL

It can return null in some cases if you look at the code: http://core.trac.wordpress.org/browser/tags/3.3.2/wp-includes/taxonomy.php#L1492

The method get_var returns null if no result is found. If you check with “==” and not “===” that should work with false or 0.