diff --git a/main/template/default/chat/chat.tpl b/main/template/default/chat/chat.tpl index d17f1eedc0..f923687dc4 100644 --- a/main/template/default/chat/chat.tpl +++ b/main/template/default/chat/chat.tpl @@ -81,14 +81,18 @@ $(function () { friend: ChChat.currentFriend }) .done(function (response) { - if (response.data.history) { - ChChat._historySize = response.data.oldFileSize; - ChChat.setHistory(response.data.history); - } - - if (response.data.userList) { - ChChat.usersOnline = response.data.usersOnline; - ChChat.setConnectedUsers(response.data.userList); + try { + if (response.data.history) { + ChChat._historySize = response.data.oldFileSize; + ChChat.setHistory(response.data.history); + } + + if (response.data.userList) { + ChChat.usersOnline = response.data.usersOnline; + ChChat.setConnectedUsers(response.data.userList); + } + } catch (error) { + console.error(error); } }); },