From ea41e84cf38d748b6e735598d02d9c488de62f1b Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Mon, 2 Jun 2025 19:11:17 +0200 Subject: [PATCH] Fixed file access after downloading the config plugin --- .../Tools/PluginSystem/PluginFactory.Download.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Download.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Download.cs index 5f3dc4cb..ff4580c5 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Download.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Download.cs @@ -43,8 +43,10 @@ public static partial class PluginFactory var response = await httpClient.GetAsync(downloadUrl, cancellationToken); if (response.IsSuccessStatusCode) { - await using var tempFileStream = File.Create(tempDownloadFile); - await response.Content.CopyToAsync(tempFileStream, cancellationToken); + await using(var tempFileStream = File.Create(tempDownloadFile)) + { + await response.Content.CopyToAsync(tempFileStream, cancellationToken); + } var configDirectory = Path.Join(CONFIGURATION_PLUGINS_ROOT, configPlugId.ToString()); if(Directory.Exists(configDirectory))