Fix invalid condition handling. bugid:112415