Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions example.csharp.greeter/GreeterPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Linq;
using System.Reflection;
using System.Text.Json;
Comment on lines +1 to 3
using Fabulor.Plugins;
Expand Down Expand Up @@ -121,13 +122,11 @@ private void LoadTargets()
try
{
var settings = JsonSerializer.Deserialize<GreeterSettings>(File.ReadAllText(SettingsPath));
foreach (var target in settings?.Targets ?? [])
foreach (var target in (settings?.Targets ?? [])
.Where(target => !string.IsNullOrWhiteSpace(target.Network)
&& !string.IsNullOrWhiteSpace(target.Channel)))
{
if (!string.IsNullOrWhiteSpace(target.Network)
&& !string.IsNullOrWhiteSpace(target.Channel))
{
_targets[TargetKey(target.Network, target.Channel)] = target;
}
_targets[TargetKey(target.Network, target.Channel)] = target;
}
}
catch (Exception error) when (error is IOException or JsonException or UnauthorizedAccessException)
Expand Down