2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-04-05 17:39:39 -04:00

fix monitor crash on no journals

This commit is contained in:
Xjph 2022-04-08 15:51:43 -02:30
parent e7f7250c08
commit 7fe11b8094

View File

@ -423,10 +423,15 @@ namespace Observatory
{ {
while (IsMonitoring()) while (IsMonitoring())
{ {
FileInfo fileToPoke = GetJournalFilesOrdered(journalFolder).Last(); var journals = GetJournalFilesOrdered(journalFolder);
using FileStream stream = fileToPoke.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); if (journals.Any())
stream.Close(); {
FileInfo fileToPoke = GetJournalFilesOrdered(journalFolder).Last();
using FileStream stream = fileToPoke.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
stream.Close();
}
System.Threading.Thread.Sleep(250); System.Threading.Thread.Sleep(250);
} }
}); });