Validating if file object is defined