Skip to content

Commit

Permalink
Prevent possible NPE during legacy file conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
JRoy committed Oct 22, 2023
1 parent 79449ef commit e2c4af7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public void setUsername(final String username) {

@Override
public boolean legacyFileExists() {
if (username == null) {
return false;
}
return new File(configFile.getParentFile(), username + ".yml").exists();
}

Expand All @@ -57,7 +60,7 @@ private File getAltFile() {

@Override
public boolean altFileExists() {
if (username.equals(username.toLowerCase())) {
if (username == null || username.equals(username.toLowerCase())) {
return false;
}
return getAltFile().exists();
Expand Down

0 comments on commit e2c4af7

Please sign in to comment.