diff --git a/app/js/directives.js b/app/js/directives.js index 37b56787..52d24252 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -356,6 +356,10 @@ angular.module('myApp.directives', ['myApp.filters']) function updateMessage($scope, element) { var message = $scope.replyMessage; + if (!message || message.deleted || !message.to_id) { + $(element).remove(); + return; + } var thumbWidth = 42; var thumbHeight = 42; var thumbPhotoSize; diff --git a/app/js/services.js b/app/js/services.js index 5a1e3935..ab978ee6 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -1943,7 +1943,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) return messagesForDialogs[msgID]; } - var message = angular.copy(messagesStorage[msgID]) || {id: msgID}; + var message = angular.copy(messagesStorage[msgID]); + + if (!message || !message.to_id) { + return message; + } if (message.chatID = message.to_id.chat_id) { message.peerID = -message.chatID;