MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
187 stars 62 forks source link

Fix error if relative path is root #33

Closed ricardoboss closed 3 years ago

ricardoboss commented 3 years ago

I ran into an error when running your script:

Reading .order file in directory docs
ERR: Something bad happend.
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')
   at System.String.Substring(Int32 startIndex, Int32 length)
   at System.String.Substring(Int32 startIndex)
   at azuredevops_export_wiki.WikiPDFExporter.ReadOrderFiles(String path) in D:\Git\WikiPDFExport\AzureDevOps.WikiPDFExport\WikiPDFExporter.cs:line 467
   at azuredevops_export_wiki.WikiPDFExporter.Export() in D:\Git\WikiPDFExport\AzureDevOps.WikiPDFExport\WikiPDFExporter.cs:line 85

This PR fixes issues if the relative path is at the root of path.