fix compile warning (bool compared with NULL)