remove double if
Merge pull request #3144 from timoschilling/rm_doubled_if

remove double if