Refactored the mapping logic in custom-domain.service to improve readability and ensure proper handling of undefined records. This change introduces an early return for nullish records and maintains existing validation behavior.