Check for null instead of try/catch