DisplayNameMixinAbstract handle null properly

This commit is contained in:
BuildTools 2016-02-24 21:45:19 +01:00 committed by Olof Larsson
parent 6c1bd25ae9
commit e74a45bd2b

View File

@ -6,6 +6,8 @@ public abstract class DisplayNameMixinAbstract implements DisplayNameMixin
{
public Mson getDisplayNameMson(Object senderObject, Object watcherObject)
{
return Mson.fromParsedMessage(this.getDisplayName(senderObject, watcherObject));
String displayName = this.getDisplayName(senderObject, watcherObject);
if (displayName == null) return null;
return Mson.fromParsedMessage(displayName);
}
}