Skip to content

Commit 40a196a

Browse files
Merge pull request #902 from krishnprakash/alert-autofix-820.12
Potential fix for code scanning alert no. 820: Generic catch clause
2 parents 239f41d + 2e25add commit 40a196a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,11 @@ private string SanitizeFeedForLogging(string feed)
547547
var port = uri.IsDefaultPort ? string.Empty : $":{uri.Port}";
548548
return $"{uri.Scheme}://{uri.Host}{port}{uri.AbsolutePath}";
549549
}
550-
catch
550+
catch (UriFormatException)
551+
{
552+
return feed;
553+
}
554+
catch (ArgumentNullException)
551555
{
552556
return feed;
553557
}

0 commit comments

Comments
 (0)