瀏覽代碼

Fix handle undefined receiver when updating an avatar

Lennart Grahl 6 年之前
父節點
當前提交
e8638f2ebb
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/services/webclient.ts

+ 4 - 0
src/services/webclient.ts

@@ -2936,6 +2936,10 @@ export class WebClientService {
 
         // Get receiver
         const receiver = this.receivers.getData({type: args.type, id: args.id});
+        if (receiver === undefined) {
+            this.$log.error(this.logTag, 'Received avatar update for nonexistent receiver');
+            return;
+        }
 
         // Set low-res avatar
         receiver.avatar.low = data;