Ugly NPE evasion. Solves the issue probably but why did it turn null even in the first place?
This commit is contained in:
parent
ac95004450
commit
34d2dcb97b
@ -642,14 +642,19 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
while (iter.hasNext())
|
||||
{
|
||||
Entry<FPerm, Set<Rel>> entry = iter.next();
|
||||
|
||||
FPerm key = entry.getKey();
|
||||
if (key == null) System.out.println("key was null");
|
||||
if (key == null)
|
||||
{
|
||||
// TODO: I have no idea why this key is null at times... Why?
|
||||
System.out.println("key was null :/");
|
||||
iter.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
Set<Rel> keyDefault = key.getDefault(this);
|
||||
Set<Rel> value = entry.getValue();
|
||||
|
||||
if (keyDefault == null) System.out.println("keyDefault was null");
|
||||
if (value == null) System.out.println("value was null");
|
||||
|
||||
if (keyDefault.equals(value))
|
||||
{
|
||||
iter.remove();
|
||||
@ -660,9 +665,6 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
}
|
||||
}
|
||||
|
||||
//System.out.println("setPerms target:");
|
||||
//System.out.println(Factions.get().gson.toJson(target, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
|
||||
|
||||
// Detect Nochange
|
||||
if (MUtil.equals(this.perms, target)) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user