Fixed style and position of the if statement per csnover. Refs #17283.