Merge pull request #185 from DSheirer/183-alias-list-throws-npe-on-empty-name

Resolves #183 - alias list throws NPE when created with a null or emp…
This commit is contained in:
Denny Sheirer
2017-02-11 00:35:16 +00:00
committed by GitHub

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;
}
}
}
}