fix: add more exception handling

Also add null check for `AddRouteDescriptor` method
This commit is contained in:
Andrew Welker
2025-02-18 14:00:53 -06:00
parent 5516ed16c3
commit 30d5e2b081
2 changed files with 24 additions and 18 deletions

View File

@@ -41,7 +41,7 @@ namespace PepperDash.Essentials.Core
&& RouteDescriptors.Any(t => t.Destination == descriptor.Destination && t.InputPort != null && descriptor.InputPort != null && t.InputPort.Key == descriptor.InputPort.Key))
{
Debug.LogMessage(LogEventLevel.Debug, descriptor.Destination,
"Route to [{0}] already exists in global routes table", descriptor.Source.Key);
"Route to [{0}] already exists in global routes table", descriptor?.Source?.Key);
return;
}
RouteDescriptors.Add(descriptor);