Don't check length if it is None.

This worked in Python2 but not Python3.  The Python3 behaviour actually
makes more sense, comparing an integer with None is indeed silly.