I think just
if (preferredVersion)
should suffice.  Except, how do you expect the text to be "null"?