Skip to content

Commit

Permalink
Fixed swallowed cast exception
Browse files Browse the repository at this point in the history
This exception caused that the deleting of a package did not work
correctly.
  • Loading branch information
ProgTrade committed May 8, 2015
1 parent 3d242a8 commit 741ad74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nUpdate.Administration/UI/Dialogs/ProjectDialog.cs
Expand Up @@ -30,8 +30,11 @@ namespace nUpdate.Administration.UI.Dialogs
{
public partial class ProjectDialog : BaseDialog, IAsyncSupportable, IResettable
{
// ReSharper disable once InconsistentNaming
private const float KB = 1024;
// ReSharper disable once InconsistentNaming
private const float MB = 1048576;
// ReSharper disable once InconsistentNaming
private const float GB = 1073741824;
private bool _allowCancel = true;
private Uri _configurationFileUrl;
Expand Down Expand Up @@ -1624,8 +1627,7 @@ private async void DeletePackage()
try
{
updateConfig.Remove(
updateConfig.First(item => new UpdateVersion(item.LiteralVersion) ==
(UpdateVersion) ((ListViewItem) enumerator.Current).Tag));
updateConfig.First(item => item.LiteralVersion == (string)((ListViewItem) enumerator.Current).Tag));
}
catch
{
Expand All @@ -1635,7 +1637,6 @@ private async void DeletePackage()
enumerator.Reset();
var configurationFilePath = Path.Combine(Program.Path, "updates.json");
try
{
File.WriteAllText(configurationFilePath, Serializer.Serialize(updateConfig));
Expand Down

0 comments on commit 741ad74

Please sign in to comment.