Prevent crashes on invalid Uri for protocol activation.

This commit is contained in:
Burak Kaan Köse
2024-08-10 14:35:01 +02:00
parent 8763bf11ab
commit 133dc91561

View File

@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using System.Web;
using CommunityToolkit.Mvvm.Messaging;
using Windows.ApplicationModel.Activation;
@@ -51,5 +52,21 @@ namespace Wino.Activation
return Task.CompletedTask;
}
protected override bool CanHandleInternal(ProtocolActivatedEventArgs args)
{
// Validate the URI scheme.
try
{
var uriGet = args.Uri;
}
catch (UriFormatException)
{
return false;
}
return base.CanHandleInternal(args);
}
}
}