Commit cff73cd6 authored by Melledy's avatar Melledy Committed by GitHub
Browse files

Merge pull request #52 from iTruth/development

Fix playerOpt is always throw an exception when it's null
parents 7fc587e7 de0a14a5
......@@ -145,7 +145,7 @@ public final class GameServer extends MihoyoKcpServer {
public Account getAccountByName(String username) {
Optional<GenshinPlayer> playerOpt = getPlayers().values().stream().filter(player -> player.getAccount().getUsername().equals(username)).findFirst();
if (playerOpt.get() != null) {
if (playerOpt.isPresent()) {
return playerOpt.get().getAccount();
}
return DatabaseHelper.getAccountByName(username);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment