mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
catch error if profile doesnt exist
This commit is contained in:
parent
8943dc76b5
commit
51149fc700
@ -87,11 +87,19 @@ namespace QSB
|
||||
|
||||
private string GetPlayerName()
|
||||
{
|
||||
var profileManager = StandaloneProfileManager.SharedInstance;
|
||||
profileManager.Initialize();
|
||||
var profile = profileManager.GetValue<StandaloneProfileManager.ProfileData>("_currentProfile");
|
||||
var profileName = profile.profileName;
|
||||
return profileName;
|
||||
try
|
||||
{
|
||||
var profileManager = StandaloneProfileManager.SharedInstance;
|
||||
profileManager.Initialize();
|
||||
var profile = profileManager._currentProfile;
|
||||
var profileName = profile.profileName;
|
||||
return profileName;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Exception when getting player name : {ex}", MessageType.Error);
|
||||
return "Player";
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupNetworkId(GameObject go, int assetId)
|
||||
|
Loading…
Reference in New Issue
Block a user