Skip to content

Commit

Permalink
Fix crash in test browser due to null ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
Feodor0090 committed Jan 24, 2023
1 parent 6a50606 commit 9f3776d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> keepSession = new();

public VkLoginBlock(OvkTabRuleset ruleset)
public VkLoginBlock(OvkTabRuleset? ruleset)
{
this.ruleset = ruleset;
}
Expand All @@ -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<string>(OvkTabRulesetSetting.Login) ?? string.Empty;
Add(new FillFlowContainer
{
Expand Down Expand Up @@ -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 }
});
Expand Down

0 comments on commit 9f3776d

Please sign in to comment.