from typing import Optional
from pathlib import Path


def get_home_path() -> Optional[str]:
    """get home directory path, return None if failed"""
    try:
        return str(Path.home())
    except RuntimeError:
        return None