Expand abnormally used ternary operator to if
Merge pull request #5279 from mikehaertl/master

[skip ci] Expand abnormally used ternary operator to if