C# error System.NullReferenceException

前端 未结 3 1464
情深已故
情深已故 2021-01-28 17:00

I have some problems with System.NullReferenceException. When server do things and we first check user is not null and then he disconnect and server progress something and it tr

3条回答
  •  隐瞒了意图╮
    2021-01-28 17:20

    SendMessage is throwing null exception, check code in your SendMessage Method

    if User goes null before call dont call SendMessage:-

     if (User != null)
     {
           User.SendMessage("crash"); //<-- No More System.NullReferenceException... -.-
     }
    

提交回复
热议问题