Fixed null pointer exception occurring when the first expression in a ternary expression returned null.