Prevent crashes on invalid Uri for protocol activation.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user