Guard against NPE if user gives pathological paths