The code has an if statement followed by a semicolon. The semicolon is interpreted as the terminator for an empty statement that is executed when the conditional expression in the if statement is true.
To correct this error
-
Remove the semicolon.
-
Follow the if statement with an empty block ({}).