Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -468,14 +468,9 @@ namespace Server.Items
{
public BBDisplayBoard(BaseBulletinBoard board) : base(0x71)
{
string name = board.BoardName;
if (name == null)
name = "";
EnsureCapacity(38);
byte[] buffer = Utility.UTF8.GetBytes(name);
byte[] buffer = Utility.UTF8.GetBytes(board.BoardName ?? "");
m_Stream.Write((byte)0x00); // PacketID
m_Stream.Write(board.Serial); // Bulletin board serial
@ -535,10 +530,7 @@ namespace Server.Items
public string SafeString(string v)
{
if (v == null)
return string.Empty;
return v;
return v ?? string.Empty;
}
}
@ -620,4 +612,4 @@ namespace Server.Items
return v;
}
}
}
}