Ignore processes that we don't have permission to get the name. Fixes #1024

This commit is contained in:
Paul Betts
2017-06-14 12:52:50 -07:00
parent 45a0c11493
commit db4676f4a7

View File

@@ -597,7 +597,7 @@ namespace Squirrel
// Finally, clean up the app-X.Y.Z directories
await toCleanup.ForEachAsync(async x => {
try {
if (runningProcesses.All(p => !p.Item1.StartsWith(x.FullName, StringComparison.OrdinalIgnoreCase))) {
if (runningProcesses.All(p => p.Item1 == null || !p.Item1.StartsWith(x.FullName, StringComparison.OrdinalIgnoreCase))) {
await Utility.DeleteDirectoryOrJustGiveUp(x.FullName);
}