diff --git a/Yavsc/ApiControllers/ChatApiController.cs b/Yavsc/ApiControllers/ChatApiController.cs index dfd794ac..f65590cd 100644 --- a/Yavsc/ApiControllers/ChatApiController.cs +++ b/Yavsc/ApiControllers/ChatApiController.cs @@ -34,6 +34,7 @@ namespace Yavsc.Controllers var uid = g.Key; var cxs = g.ToList(); + if (cxs !=null) if (cxs.Count>0) { var user = cxs.First().Owner; diff --git a/Yavsc/Views/Home/Chat.cshtml b/Yavsc/Views/Home/Chat.cshtml index 34bca244..dcc56379 100644 --- a/Yavsc/Views/Home/Chat.cshtml +++ b/Yavsc/Views/Home/Chat.cshtml @@ -56,6 +56,8 @@ function(users) { $.each(users, function () { var user = this; + var existent = $('#userlist li').filterByData("name",user.UserName); + if (existent.length>0) existent.remove(); var li = $('