Don't use ternary if statements. Fixes #8784
Merge pull request #8790 from sivel/issue/8784

Don't use ternary if statements. Fixes #8784