adam bien's blog

The Only Reason To Use Curly Brackets Blocks For IF-Statements 📎

Without curly brackets, you could accidentally write a semicolon after the IF-statements. The semicolon is a valid, empty statement, which will be "execute" instead of the actual (intended) one.

         if(condition );
                doSomething();

So either write the IF-statements with curly brackets blocks:

         if(condition ){
                doSomething();
         }

...or carefully search for semicolons after the IF-statement.