Sfoglia il codice sorgente

Check if receiver avatar object is undefined (#164)

Fixes #163
Silly 9 anni fa
parent
commit
8cf6bfbfe4
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      src/directives/avatar.ts

+ 3 - 1
src/directives/avatar.ts

@@ -56,7 +56,9 @@ export default [
                 this.getAvatar = () => {
                     if (this.avatarExists()) {
                         return this.receiver.avatar[this.resolution];
-                    } else if (this.highResolution && this.receiver.avatar.low !== undefined) {
+                    } else if (this.highResolution
+                        && this.receiver.avatar !== undefined
+                        && this.receiver.avatar.low !== undefined) {
                         return this.receiver.avatar.low;
                     }
                     return webClientService.defaults.getAvatar(this.type, this.highResolution);