from typing import Optional


def validate_ref_dataset_optional(ref_dataset: Optional[int]) -> Optional[int]:
    """
    Validates the reference to a dataset of an object.

    :param ref_dataset: The reference to a dataset of the object.
    :return: The validated reference to a dataset.
    """
    if ref_dataset is None:
        return None
    if ref_dataset <= 0:
        raise ValueError("Reference to a dataset must be positive.")

    return ref_dataset