Skip to content

Commit

Permalink
Merge pull request #66 from yfdyh000/fixcrash
Browse files Browse the repository at this point in the history
Fix startup crash
  • Loading branch information
DavidMoore committed Apr 18, 2020
2 parents 708c12f + bd58736 commit e0ffba3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
12 changes: 7 additions & 5 deletions Code/IPFilter/Apps/DelugeApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,18 @@ public Task<ApplicationDetectionResult> DetectAsync()
var result = ApplicationDetectionResult.Create(this, "Deluge", Path.GetDirectoryName(path));

var exe = new FileInfo(path);
if (!exe.Exists)
if (exe.Exists)
{
var version = FileVersionInfo.GetVersionInfo(exe.FullName);
result.Description = version.ProductName;
result.Version = version.FileVersion;
}
else
{
Trace.TraceInformation("Deluge exe not found @ " + path);
result.IsPresent = false;
}

var version = FileVersionInfo.GetVersionInfo(exe.FullName);
result.Description = version.ProductName;
result.Version = version.FileVersion;

return Task.FromResult(result);
}

Expand Down
15 changes: 10 additions & 5 deletions Code/IPFilter/Apps/EmuleApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ public Task<ApplicationDetectionResult> DetectAsync()
var result = ApplicationDetectionResult.Create(this, DefaultDisplayName, installLocation);

var exe = new FileInfo(Path.Combine(installLocation, "emule.exe"));
if (!exe.Exists) result.IsPresent = false;
if (exe.Exists)
{
var version = FileVersionInfo.GetVersionInfo(exe.FullName);
result.Description = version.ProductName;
result.Version = version.FileVersion;
}
else
{
result.IsPresent = false;
}

var version = FileVersionInfo.GetVersionInfo(exe.FullName);
result.Description = version.ProductName;
result.Version = version.FileVersion;

return Task.FromResult(result);
}
}
Expand Down

0 comments on commit e0ffba3

Please sign in to comment.