adds a null check for RelayIMtoAvatar

This commit is contained in:
Madpeter 2020-04-26 00:13:09 +01:00
parent 5453f26d66
commit 372c4c42cf

View file

@ -52,13 +52,16 @@ namespace BSB.bottypes
{ {
if(avatar == true) if(avatar == true)
{ {
if(myconfig.RelayImToAvatar != UUID.Zero.ToString()) if (myconfig.RelayImToAvatar != null)
{ {
if (myconfig.RelayImToAvatar.Length == UUID.Zero.ToString().Length) if (myconfig.RelayImToAvatar != UUID.Zero.ToString())
{ {
if(UUID.TryParse(myconfig.RelayImToAvatar,out UUID targetav) == true) if (myconfig.RelayImToAvatar.Length == UUID.Zero.ToString().Length)
{ {
Client.Self.InstantMessage(targetav, "Relay-> "+sender_name+": " + message + ""); if (UUID.TryParse(myconfig.RelayImToAvatar, out UUID targetav) == true)
{
Client.Self.InstantMessage(targetav, "Relay-> " + sender_name + ": " + message + "");
}
} }
} }
} }