mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Prevent exception from being thrown if a rogue LineComplete message is received
This commit is contained in:
parent
405a5aad85
commit
aa0852a3b2
1 changed files with 6 additions and 0 deletions
|
@ -365,6 +365,12 @@ namespace Nibriboard.Client
|
|||
/// <param name="message">The message to handle.</param>
|
||||
protected async Task handleLineCompleteMessage(LineCompleteMessage message)
|
||||
{
|
||||
// If the line doesn't exist, then ignore it
|
||||
if(!manager.LineIncubator.LineExists(message.LineId))
|
||||
{
|
||||
Log.WriteLine("[NibriClient/handlers] Ignoring LineComplete event for line that doesn't exist");
|
||||
return;
|
||||
}
|
||||
DrawnLine line = manager.LineIncubator.CompleteLine(message.LineId);
|
||||
line.LineWidth = message.LineWidth;
|
||||
line.Colour = message.LineColour;
|
||||
|
|
Loading…
Reference in a new issue