From 16f49a607d223cfa45607cbec9bc54ffb5f7d21d Mon Sep 17 00:00:00 2001 From: Donkey Date: Tue, 22 Oct 2024 21:54:25 +0200 Subject: [PATCH] fix(NuGetServer): after installing a package from a NuGet server there is an exception if the package is not located on the first NuGet repository --- TwinpackShared/Protocol/Nuget/NugetServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TwinpackShared/Protocol/Nuget/NugetServer.cs b/TwinpackShared/Protocol/Nuget/NugetServer.cs index 0ebfc53..a95cbdf 100644 --- a/TwinpackShared/Protocol/Nuget/NugetServer.cs +++ b/TwinpackShared/Protocol/Nuget/NugetServer.cs @@ -333,7 +333,7 @@ public virtual async Task GetPackageVersionAsync(PlcL IPackageSearchMetadata x = library.Version == null ? packages.FirstOrDefault() : packages.FirstOrDefault(p => p.Identity.Version.Version.ToString() == library.Version); if (x == null) - throw new Exceptions.LibraryNotFoundException(library.Name, library.Version, $"Package {library.Name} {library.Version} (distributor: {library.DistributorName}) not found!"); + return new PackageVersionGetResponse(); if (!x.Tags?.ToLower().Contains("library") == true && !x.Tags?.ToLower().Contains("plc-library") == true) throw new Exceptions.LibraryFileInvalidException($"Package {library.Name} {library.Version} (distributor: {library.DistributorName}) does not have a 'plc-library' or 'library' tag!");