Do "x if y == nil" instead of "y or x"

I don't know why this doesn't work.