Skip to content

Commit

Permalink
Fixed corner case issue with file path not being used correctly (#81)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcin Przywóski <[email protected]>
  • Loading branch information
marcin-przywoski and Marcin Przywóski authored Sep 3, 2024
1 parent 266c33f commit 4cb114c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ExportViewer.Core/Services/HtmlParsingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task<IEnumerable<Message>> GetMessages (string filePath , CultureIn

DateTime date = Convert.ToDateTime(divDate , locale);

if (File.Exists(exportLocation + href))
if (File.Exists(Path.Combine(exportLocation, href)))
{
messages.Add(new Message { Link = href , Date = date });
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public async Task<IEnumerable<Message>> GetMessages (string filePath , CultureIn

DateTime parsedDate = DateTime.ParseExact(divDate.TextContent , "MMM dd, yyyy h:mm:sstt" , locale);

if (File.Exists(exportLocation + href))
if (File.Exists(Path.Combine(exportLocation, href)))
{
messages.Add(new Message { Link = href , Date = parsedDate });
}
Expand Down Expand Up @@ -133,7 +133,7 @@ public async Task<IEnumerable<Message>> GetMessages (string filePath , CultureIn

DateTime parsedDate = DateTime.ParseExact(divDate.TextContent , "MMM dd, yyyy h:mm:sstt" , locale);

if (File.Exists(exportLocation + href))
if (File.Exists(Path.Combine(exportLocation, href)))
{
messages.Add(new Message { Link = href , Date = parsedDate });
}
Expand Down Expand Up @@ -163,7 +163,7 @@ public async Task<IEnumerable<Message>> GetMessages (string filePath , CultureIn

DateTime parsedDate = DateTime.ParseExact(divDate.TextContent , "MMM dd, yyyy h:mm:sstt" , locale);

if (File.Exists(exportLocation + href))
if (File.Exists(Path.Combine(exportLocation, href)))
{
messages.Add(new Message { Link = href , Date = parsedDate });
}
Expand Down

0 comments on commit 4cb114c

Please sign in to comment.