Test whether $record is defined before checking its contents.