Conversion problem

conversion first and then if condition