Resolves #183 - alias list throws NPE when created with a null or empty name and receives alias updates.

This commit is contained in:
Denny
2017-02-10 19:34:50 -05:00
parent 861203c3a0
commit 2ca9e5d5ce

View File

@@ -631,11 +631,21 @@ public class AliasList implements Listener<AliasEvent>
return mName; return mName;
} }
/**
* Indicates if this alias list has a non-null, non-empty name
*/
private boolean hasName()
{
return mName != null && !mName.isEmpty();
}
/** /**
* Receive alias change event notifications and modify this list accordingly * Receive alias change event notifications and modify this list accordingly
*/ */
@Override @Override
public void receive(AliasEvent event) public void receive(AliasEvent event)
{
if(hasName())
{ {
Alias alias = event.getAlias(); Alias alias = event.getAlias();
@@ -664,3 +674,4 @@ public class AliasList implements Listener<AliasEvent>
} }
} }
} }
}