Skip to content

Commit

Permalink
prevent some npe s caused by uuid conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
xyztobixyz committed Aug 17, 2014
1 parent 9137c93 commit ec5491e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/com/dre/managerxl/MPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ public static Set<MPlayer> get() {

public static MPlayer get(UUID uuid) {
for (MPlayer mPlayer : mPlayers) {
if (mPlayer.getUUID().equals(uuid)) {
return mPlayer;
if (mPlayer != null){
if (mPlayer.getUUID().equals(uuid)) {
return mPlayer;
}
}
}

Expand All @@ -75,8 +77,10 @@ public static MPlayer get(UUID uuid) {

public static MPlayer getOrCreate(UUID uuid) {
for (MPlayer mPlayer : mPlayers) {
if (mPlayer.getUUID().equals(uuid)) {
return mPlayer;
if (mPlayer != null){
if (mPlayer.getUUID().equals(uuid)) {
return mPlayer;
}
}
}

Expand Down

0 comments on commit ec5491e

Please sign in to comment.