Reverse order of test to avoid having a potentially unreachable null che...

...ck.