File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
Plugins/Flow.Launcher.Plugin.PluginsManager Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -163,9 +163,12 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
163
163
if ( canReportProgress &&
164
164
( prgBox = Context . API . ShowProgressBox ( prgBoxTitle , ( ) =>
165
165
{
166
- httpClient . CancelPendingRequests ( ) ;
167
- downloadCancelled = true ;
168
- prgBox = null ;
166
+ if ( prgBox != null )
167
+ {
168
+ httpClient . CancelPendingRequests ( ) ;
169
+ downloadCancelled = true ;
170
+ prgBox = null ;
171
+ }
169
172
} ) ) != null )
170
173
{
171
174
await using var contentStream = await response . Content . ReadAsStreamAsync ( ) . ConfigureAwait ( false ) ;
@@ -185,19 +188,19 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
185
188
// check if user cancelled download before reporting progress
186
189
if ( downloadCancelled )
187
190
return ;
188
-
189
- prgBox . ReportProgress ( progressValue ) ;
191
+ else
192
+ prgBox . ReportProgress ( progressValue ) ;
190
193
}
191
194
192
195
// check if user cancelled download before closing progress box
193
196
if ( downloadCancelled )
194
197
return ;
195
-
196
- Application . Current . Dispatcher . Invoke ( ( ) =>
197
- {
198
- prgBox . Close ( ) ;
199
- prgBox = null ;
200
- } ) ;
198
+ else
199
+ Application . Current . Dispatcher . Invoke ( ( ) =>
200
+ {
201
+ prgBox . Close ( ) ;
202
+ prgBox = null ;
203
+ } ) ;
201
204
}
202
205
else
203
206
{
@@ -212,8 +215,8 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
212
215
// check if user cancelled download before installing plugin
213
216
if ( downloadCancelled )
214
217
return ;
215
-
216
- Install ( plugin , filePath ) ;
218
+ else
219
+ Install ( plugin , filePath ) ;
217
220
}
218
221
catch ( HttpRequestException e )
219
222
{
You can’t perform that action at this time.
0 commit comments