But if there is the remotest change that you will have nulls in your table, then you have to go with a bit more pythonic magic which basically does a true/false test. if the field called 'afield' is None (aka Null) then you take the slice to the right of the selection options. If it contains text, then you take the slice to the left, which is the false part.
So in short the syntax is [ false section, true section][query] or [0, 1][query] [False, True][query] useful functionality avoiding code blocks for simple yes/no questions
[!afield![0], None][!afield! is None]