It's a good practice to always use braces with if / else even if it's just one line in them.
That lone } which seemingly belongs to if in this case would be closing the function.
It's a good practice to always use braces with if / else even if it's just one line in them.