Skip to content

Commit 135fd03

Browse files
committed
Improve code quality
1 parent 73a6fb6 commit 135fd03

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

Flow.Launcher/Helper/PluginInstallationHelper.cs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,17 @@ await DownloadFileAsync(
5757
{
5858
return;
5959
}
60-
else
60+
61+
if (!File.Exists(filePath))
6162
{
62-
if (!File.Exists(filePath))
63-
{
64-
throw new FileNotFoundException($"Plugin {newPlugin.ID} zip file not found at {filePath}", filePath);
65-
}
63+
throw new FileNotFoundException($"Plugin {newPlugin.ID} zip file not found at {filePath}", filePath);
64+
}
6665

67-
App.API.InstallPlugin(newPlugin, filePath);
66+
App.API.InstallPlugin(newPlugin, filePath);
6867

69-
if (!newPlugin.IsFromLocalInstallPath)
70-
{
71-
File.Delete(filePath);
72-
}
68+
if (!newPlugin.IsFromLocalInstallPath)
69+
{
70+
File.Delete(filePath);
7371
}
7472
}
7573
catch (Exception e)
@@ -201,10 +199,8 @@ await DownloadFileAsync(
201199
{
202200
return;
203201
}
204-
else
205-
{
206-
await App.API.UpdatePluginAsync(oldPlugin, newPlugin, filePath);
207-
}
202+
203+
await App.API.UpdatePluginAsync(oldPlugin, newPlugin, filePath);
208204
}
209205
catch (Exception e)
210206
{

0 commit comments

Comments
 (0)