Skip to content

Commit

Permalink
Handle corrupt history files appropriately (#238)
Browse files Browse the repository at this point in the history
Closes #238
  • Loading branch information
stnkl committed Jun 10, 2022
1 parent 34a45ee commit 0813ede
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion EverythingToolbar/Helpers/HistoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ public List<string> LoadHistory()
var serializer = new XmlSerializer(history.GetType());
using (var reader = XmlReader.Create(historyPath))
{
return (List<string>)serializer.Deserialize(reader);
try
{
return (List<string>)serializer.Deserialize(reader);
}
catch (InvalidOperationException e)
{
ToolbarLogger.GetLogger("EverythingToolbar").Error(e, "Failed to load search term history.");
}
}
}

Expand Down

0 comments on commit 0813ede

Please sign in to comment.