Guard against the absence of path segments.
Merge pull request #289 from square/jw/no-path-segments

Guard against the absence of path segments.