fixed ternary if

Apparently evaluating the truthiness of undefined doesn't work as
expected in the ternery if statement