mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 06:57:39 +01:00
Prevent possible NPE during legacy file conversion (#5551)
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This commit is contained in:
parent
3eceec87d3
commit
50c4d04b02
@ -34,6 +34,9 @@ public class EssentialsUserConfiguration extends EssentialsConfiguration {
|
||||
|
||||
@Override
|
||||
public boolean legacyFileExists() {
|
||||
if (username == null) {
|
||||
return false;
|
||||
}
|
||||
return new File(configFile.getParentFile(), username + ".yml").exists();
|
||||
}
|
||||
|
||||
@ -57,7 +60,7 @@ public class EssentialsUserConfiguration extends EssentialsConfiguration {
|
||||
|
||||
@Override
|
||||
public boolean altFileExists() {
|
||||
if (username.equals(username.toLowerCase())) {
|
||||
if (username == null || username.equals(username.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
return getAltFile().exists();
|
||||
|
Loading…
Reference in New Issue
Block a user