From 9f3776d4e1c35f7db18e5eaacbf31a3d809101bc Mon Sep 17 00:00:00 2001 From: ansel <79257300125@ya.ru> Date: Tue, 24 Jan 2023 09:38:36 +0300 Subject: [PATCH] Fix crash in test browser due to null ruleset --- .../UI/Components/Account/VkLoginBlock.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.OvkTab/UI/Components/Account/VkLoginBlock.cs b/osu.Game.Rulesets.OvkTab/UI/Components/Account/VkLoginBlock.cs index e9928d7..1636549 100644 --- a/osu.Game.Rulesets.OvkTab/UI/Components/Account/VkLoginBlock.cs +++ b/osu.Game.Rulesets.OvkTab/UI/Components/Account/VkLoginBlock.cs @@ -26,11 +26,11 @@ internal partial class VkLoginBlock : Container private OvkOverlay ovk { get; set; } private OvkTabConfig? config; - private readonly OvkTabRuleset ruleset; + private readonly OvkTabRuleset? ruleset; private readonly Bindable keepSession = new(); - public VkLoginBlock(OvkTabRuleset ruleset) + public VkLoginBlock(OvkTabRuleset? ruleset) { this.ruleset = ruleset; } @@ -39,7 +39,8 @@ public VkLoginBlock(OvkTabRuleset ruleset) void load(IRulesetConfigCache? c) { RelativeSizeAxes = Axes.Both; - config = c?.GetConfigFor(ruleset) as OvkTabConfig; + if (ruleset != null) + config = c?.GetConfigFor(ruleset) as OvkTabConfig; string loginStr = config?.Get(OvkTabRulesetSetting.Login) ?? string.Empty; Add(new FillFlowContainer { @@ -98,7 +99,7 @@ void load(IRulesetConfigCache? c) Text = "This is an experimental project, that works via multiple hacks." + " If you experience problems with the game, uninstall this extension before attempting to diagnose them. 2FA not supported, you will have to disable it. " + "Your login, id and token will be stored in osu! database as plain text! No encryption yet, at all!", - Position = new(0, -40), + Position = new(0, -50), TextAnchor = Anchor.TopCentre, Padding = new() { Horizontal = 40 } });