An @end statement is missing a matching @if statement. Since the @end statement terminates an @if...@end block, every @if statement must have a matching @end statement, and vice versa.
To correct this error
-
Make sure an @if statement precedes each @end statement.