diff --git a/src/ui/Forms/Compare.cs b/src/ui/Forms/Compare.cs
index 6a0eec4fc..6adeb5e6d 100644
--- a/src/ui/Forms/Compare.cs
+++ b/src/ui/Forms/Compare.cs
@@ -1319,7 +1319,7 @@ namespace Nikse.SubtitleEdit.Forms
sb.AppendLine("
Subtitle Edit compare");
sb.AppendLine(" ");
sb.AppendLine(" ");
sb.AppendLine(" ");
sb.AppendLine(" Subtitle Edit compare
");
@@ -1366,7 +1366,14 @@ namespace Nikse.SubtitleEdit.Forms
private static string GetFileName(string fileName)
{
- return string.IsNullOrEmpty(fileName) ? string.Empty : Path.GetFileName(fileName);
+ try
+ {
+ return string.IsNullOrEmpty(fileName) ? string.Empty : Path.GetFileName(fileName);
+ }
+ catch
+ {
+ return fileName;
+ }
}
private static string GetHtmlText(Paragraph p, string text)