Fix pda crash from code being outside if statement (#1079)

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
This commit is contained in:
FL-OZ
2020-06-05 16:58:00 -05:00
committed by GitHub
parent 9ffdd023fe
commit 41c9944c41

View File

@@ -111,6 +111,10 @@ namespace Content.Client.GameObjects.Components.PDA
if (msg.Account != null)
{
_menu.CurrentLoggedInAccount = msg.Account;
var balance = msg.Account.DataBalance;
var weightedColor = GetWeightedColorString(balance);
_menu.BalanceInfo.SetMarkup(Loc.GetString("TC Balance: [color={0}]{1}[/color]", weightedColor, balance));
}
if (msg.Listings != null)
@@ -121,10 +125,6 @@ namespace Content.Client.GameObjects.Components.PDA
_menu.AddListingGui(item);
}
}
var balance = _menu.CurrentLoggedInAccount.DataBalance;
var weightedColor = GetWeightedColorString(balance);
_menu.BalanceInfo.SetMarkup(Loc.GetString("TC Balance: [color={0}]{1}[/color]", weightedColor, balance));
_menu.MasterTabContainer.SetTabVisible(1, msg.Account != null);
break;
}