Add a handler in the case that the player instance is null in Profile
This commit is contained in:
parent
fdacdeb641
commit
19d99091b7
2 changed files with 14 additions and 2 deletions
|
@ -53,7 +53,7 @@ mod_name=Zontreck Library Mod
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=GPLv3
|
mod_license=GPLv3
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=1.9.121823.1318
|
mod_version=1.9.121923.1104
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
@ -69,11 +69,23 @@ public class Profile {
|
||||||
this.accessor = vaultFile;
|
this.accessor = vaultFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean runSanityChecks()
|
||||||
|
{
|
||||||
|
if(player == null) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Profile get_profile_of(String UUID) throws UserProfileNotYetExistsException
|
public static Profile get_profile_of(String UUID) throws UserProfileNotYetExistsException
|
||||||
{
|
{
|
||||||
if(LibZontreck.PROFILES.containsKey(UUID)){
|
if(LibZontreck.PROFILES.containsKey(UUID)){
|
||||||
return LibZontreck.PROFILES.get(UUID);
|
Profile prof = LibZontreck.PROFILES.get(UUID);
|
||||||
|
if(!prof.runSanityChecks())
|
||||||
|
{
|
||||||
|
LibZontreck.PROFILES.remove(prof);
|
||||||
|
return get_profile_of(UUID);
|
||||||
|
}
|
||||||
|
return prof;
|
||||||
}else {
|
}else {
|
||||||
// Create or load profile
|
// Create or load profile
|
||||||
Path userProfile = BASE.resolve(UUID);
|
Path userProfile = BASE.resolve(UUID);
|
||||||
|
|
Reference in a new issue