As I said, it wouldn't be a syntax error if ... contained the matching { somewhere inside.
That lone } which seemingly belongs to if in this case would be closing the function.
That lone } which seemingly belongs to if in this case would be closing the function.