Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
cff73cd6
Commit
cff73cd6
authored
Apr 20, 2022
by
Melledy
Committed by
GitHub
Apr 20, 2022
Browse files
Merge pull request #52 from iTruth/development
Fix playerOpt is always throw an exception when it's null
parents
7fc587e7
de0a14a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/game/GameServer.java
View file @
cff73cd6
...
@@ -145,7 +145,7 @@ public final class GameServer extends MihoyoKcpServer {
...
@@ -145,7 +145,7 @@ public final class GameServer extends MihoyoKcpServer {
public
Account
getAccountByName
(
String
username
)
{
public
Account
getAccountByName
(
String
username
)
{
Optional
<
GenshinPlayer
>
playerOpt
=
getPlayers
().
values
().
stream
().
filter
(
player
->
player
.
getAccount
().
getUsername
().
equals
(
username
)).
findFirst
();
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
playerOpt
.
get
().
getAccount
();
}
}
return
DatabaseHelper
.
getAccountByName
(
username
);
return
DatabaseHelper
.
getAccountByName
(
username
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment