Просмотр исходного кода

Handle undefined messages in showVoipInfo

Danilo Bargen 8 лет назад
Родитель
Сommit
0ac33dd053
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/directives/latest_message.ts

+ 3 - 2
src/directives/latest_message.ts

@@ -47,9 +47,10 @@ export default [
 
                 this.isGroup = this.type as threema.ReceiverType === 'group';
                 this.isDistributionList = !this.isGroup
-                    &&  this.type as threema.ReceiverType === 'distributionList';
+                    && this.type as threema.ReceiverType === 'distributionList';
 
-                this.showVoipInfo = (this.message as threema.Message).type === 'voipStatus';
+                this.showVoipInfo = this.message
+                    && (this.message as threema.Message).type === 'voipStatus';
 
                 this.defaultStatusIcon = this.showVoipInfo ? 'phone_locked' :
                     (this.isGroup ? 'group' : (this.isDistributionList ? 'forum' : null));