mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
Fix remaining null checks
This commit is contained in:
parent
1f8abcdf6c
commit
145e42928b
@ -43,7 +43,7 @@ namespace osu.Game.Graphics.Containers
|
||||
AddText(text[previousLinkEnd..link.Index]);
|
||||
|
||||
string displayText = text.Substring(link.Index, link.Length);
|
||||
string linkArgument = link.Argument ?? link.Url;
|
||||
string linkArgument = link.Argument;
|
||||
string tooltip = displayText == link.Url ? null : link.Url;
|
||||
|
||||
AddLink(displayText, link.Action, linkArgument, tooltip);
|
||||
@ -57,7 +57,7 @@ namespace osu.Game.Graphics.Containers
|
||||
createLink(AddText(text, creationParameters), new LinkDetails(LinkAction.External, url), url);
|
||||
|
||||
public void AddLink(string text, Action action, string tooltipText = null, Action<SpriteText> creationParameters = null)
|
||||
=> createLink(AddText(text, creationParameters), new LinkDetails(LinkAction.Custom, null), tooltipText, action);
|
||||
=> createLink(AddText(text, creationParameters), new LinkDetails(LinkAction.Custom, @"action"), tooltipText, action);
|
||||
|
||||
public void AddLink(string text, LinkAction action, string argument, string tooltipText = null, Action<SpriteText> creationParameters = null)
|
||||
=> createLink(AddText(text, creationParameters), new LinkDetails(action, argument), tooltipText);
|
||||
|
@ -277,7 +277,7 @@ namespace osu.Game
|
||||
{
|
||||
case LinkAction.OpenBeatmap:
|
||||
// TODO: proper query params handling
|
||||
if (link.Argument != null && int.TryParse(link.Argument.Contains('?') ? link.Argument.Split('?')[0] : link.Argument, out int beatmapId))
|
||||
if (int.TryParse(link.Argument.Contains('?') ? link.Argument.Split('?')[0] : link.Argument, out int beatmapId))
|
||||
ShowBeatmap(beatmapId);
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user