Skip to content

Commit

Permalink
fix: Make the add-in disocvery safer
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Nov 7, 2024
1 parent 60f770c commit 4151902
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/Uno.UI.RemoteControl.Host/Extensibility/AddIns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,18 @@ public static IImmutableList<string> Discover(string solutionFile)

private static ImmutableList<string> Read(string file)
{
var values = File
.ReadAllLines(file, Encoding.Unicode)
.SelectMany(line => line.Split(['\r', '\n', ';', ','], StringSplitOptions.RemoveEmptyEntries))
.Select(value => value.Trim())
.Where(value => value is { Length: > 0 })
.Distinct(StringComparer.OrdinalIgnoreCase)
.ToImmutableList();
var values = ImmutableList<string>.Empty;
try
{
values = File
.ReadAllLines(file, Encoding.Unicode)
.SelectMany(line => line.Split(['\r', '\n', ';', ','], StringSplitOptions.RemoveEmptyEntries))
.Select(value => value.Trim())
.Where(value => value is { Length: > 0 })
.Distinct(StringComparer.OrdinalIgnoreCase)
.ToImmutableList();
}
catch { }

Check warning on line 76 in src/Uno.UI.RemoteControl.Host/Extensibility/AddIns.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Uno.UI.RemoteControl.Host/Extensibility/AddIns.cs#L76

Either remove or fill this block of code.

try
{
Expand Down

0 comments on commit 4151902

Please sign in to comment.