Reverse checks for safer code path

Check first for valid result before using it!