From: miniduikboot Date: Sat, 8 Jan 2022 16:38:22 +0000 (+0100) Subject: Clamp taskCount to the length of the task list X-Git-Tag: v1.7.0~16^2 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=50a526a02dabb7a1a8a4a1cbd07c91936c197670;p=rhonda%2Fimpostor.git Clamp taskCount to the length of the task list New tasks cannot be created at this point because we don't know the underlying tasks. So we try to maintain the tasks we do know of. --- diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs index 0b1abce..71bd53d 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs @@ -85,9 +85,9 @@ namespace Impostor.Server.Net.Inner.Objects var taskCount = reader.ReadByte(); - if (Tasks.Count != taskCount) + if (Tasks.Count < taskCount) { - Tasks = new List(taskCount); + taskCount = (byte)Tasks.Count; } for (var i = 0; i < taskCount; i++)