Skip to content

Commit

Permalink
fix startup crash
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegiacometti authored and bostrot committed Jul 21, 2023
1 parent cae3305 commit dfcd7b0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Main.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

Expand Down Expand Up @@ -65,8 +65,6 @@ public partial class Main : IPlugin, IPluginI18n, IContextMenu, ISettingProvider
// constructor
public Main()
{
GetPackages();
LoadInstalledList();
}

private static void LoadInstalledList()
Expand Down Expand Up @@ -102,7 +100,7 @@ public class WingetPackage
public string Version { get; set; }
}

private static async void GetPackages()
private static async Task GetPackagesAsync()
{
// Download packages list
var packages = new List<string>();
Expand Down Expand Up @@ -199,6 +197,9 @@ public void Init(PluginInitContext context)
$"Plugin: {Properties.Resources.plugin_name}",
errorMsgString);
};

GetPackagesAsync().Wait();
LoadInstalledList();
}

public static void Winget(string cmd)
Expand Down

0 comments on commit dfcd7b0

Please sign in to comment.