Prevent possible NPE during legacy file conversion (#5551)

Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com>
This commit is contained in:
Josh Roy 2023-11-10 19:27:06 -05:00 committed by GitHub
parent 3eceec87d3
commit 50c4d04b02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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();