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;
}
/**
* 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
*/
@Override
public void receive(AliasEvent event)
{
if(hasName())
{
Alias alias = event.getAlias();
@@ -663,4 +673,5 @@ public class AliasList implements Listener<AliasEvent>
break;
}
}
}
}