diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-11-19 20:46:34 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-11-19 20:46:34 +0000 |
commit | 317b0833ef66ac1e97c72e9bbea706eddf549f5d (patch) | |
tree | a80e384a626766683e28909c43aa0a246b54725e /EssentialsGroupManager/src/org/anjocaido/groupmanager | |
parent | 7b7d1f557f193599222ca90e74a967b3c7c0fe3c (diff) | |
download | Essentials-317b0833ef66ac1e97c72e9bbea706eddf549f5d.tar Essentials-317b0833ef66ac1e97c72e9bbea706eddf549f5d.tar.gz Essentials-317b0833ef66ac1e97c72e9bbea706eddf549f5d.tar.lz Essentials-317b0833ef66ac1e97c72e9bbea706eddf549f5d.tar.xz Essentials-317b0833ef66ac1e97c72e9bbea706eddf549f5d.zip |
Prevent Group.equals tests throwing a NullPointerException for
GlobalGroups.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java index 6f2fdd3b3..8ae272328 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java @@ -39,7 +39,9 @@ public abstract class DataUnit { public boolean equals(Object o) { if (o instanceof DataUnit) { DataUnit go = (DataUnit) o; - if (this.getName().equalsIgnoreCase(go.getName()) && this.dataSource.getName().equalsIgnoreCase(go.getDataSource().getName())) { + if (this.getName().equalsIgnoreCase(go.getName()) + && ((this.dataSource == null && go.getDataSource() == null) + || (this.dataSource.getName().equalsIgnoreCase(go.getDataSource().getName())))) { return true; } } |