Skip to content

Commit 4b9faa5

Browse files
committed
Destroy HyperlinkOpenDialog when URL is null too
1 parent 3e55789 commit 4b9faa5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CommunityBugFixCollection/AnyProtocolHyperlinks.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ private static bool HyperlinkOpenDialogOpenPrefix(HyperlinkOpenDialog __instance
2424
if (!Enabled)
2525
return true;
2626

27-
if (__instance.World != Userspace.UserspaceWorld || __instance.URL.Value is null)
27+
if (__instance.World != Userspace.UserspaceWorld)
2828
return false;
2929

30-
Logger.Debug(() => $"Opening Hyperlink: {__instance.URL.Value}");
31-
__instance.RunInBackground(() => Process.Start(__instance.URL.Value.ToString()));
30+
if (__instance.URL.Value is not null)
31+
{
32+
Logger.Debug(() => $"Opening Hyperlink: {__instance.URL.Value}");
33+
__instance.RunInBackground(() => Process.Start(__instance.URL.Value.ToString()));
34+
}
3235

3336
__instance.Slot.Destroy();
3437

0 commit comments

Comments
 (0)