Handle null in GetDirectoryPath