```
                if (segment == "..")
                  buildDirectoryFile = buildDirectoryFile.parent;
                else
                  buildDirectoryFile.append(segment);
```
That seems to fix this exception.