Skip to content

Commit

Permalink
Merge pull request #179 from cg-tuwien/pbh-bugfix
Browse files Browse the repository at this point in the history
Handles a situation gracefully where PostBuildHelper previously crashed
  • Loading branch information
johannesugb authored Oct 9, 2023
2 parents c5451cf + 3f14c53 commit 7b37962
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1084,16 +1084,26 @@ where CgbUtils.NormalizePath(k) == CgbUtils.NormalizePath(fi.DirectoryName)

foreach (var w in watches)
{
var watchDir = new WatchedDirectoryVM(this, inst, w.Key);

foreach (var f in w.Value)
try
{
watchDir.Files.Add(f);
}
var watchDir = new WatchedDirectoryVM(this, inst, w.Key);

foreach (var f in w.Value)
{
watchDir.Files.Add(f);
}

// Start to watch:
inst.CurrentlyWatchedDirectories.Add(watchDir);
watchDir.NightGathersAndNowMyWatchBegins();
// Start to watch:
inst.CurrentlyWatchedDirectories.Add(watchDir);
watchDir.NightGathersAndNowMyWatchBegins();
}
catch (Exception ex)
{
AddToMessagesList(Message.Create(MessageType.Error, $"Failed to establish FileSystemWatcher for {w.Key}", () =>
{
MessageBox.Show(ex.Message);
}), inst);
}
}
}

Expand Down

0 comments on commit 7b37962

Please sign in to comment.