Skip to content

Commit 787f539

Browse files
kennytvJRoy
andauthored
Prevent NPE in getPlayerLocale for offline players (#6435)
I hope this message finds you well. This pull requests prevents an NPE in getPlayerLocale for offline players. Co-authored-by: JRoy <10731363+JRoy@users.noreply.github.com>
1 parent 6ab56d2 commit 787f539

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • Essentials/src/main/java/com/earth2me/essentials

Essentials/src/main/java/com/earth2me/essentials/User.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ public void checkActivity() {
841841
&& !isAuthorized("essentials.afk.kickexempt")) {
842842
lastActivity = 0;
843843
final double kickTime = autoafktimeout / 60.0;
844-
844+
845845
// If `afk-timeout-command` in config.yml is empty, use default Essentials kicking behaviour instead of executing a command.
846846
if (ess.getSettings().getAfkTimeoutCommands().isEmpty()) {
847847
this.getBase().kickPlayer(AdventureUtil.miniToLegacy(playerTl("autoAfkKickReason", kickTime)));
@@ -1112,7 +1112,7 @@ public String tlSender(String tlKey, Object... args) {
11121112
}
11131113

11141114
public Locale getPlayerLocale(final String locale) {
1115-
if (locale.equals(lastLocaleString)) {
1115+
if (locale == null || locale.equals(lastLocaleString)) {
11161116
return playerLocale;
11171117
}
11181118
lastLocaleString = locale;

0 commit comments

Comments
 (0)