Pārlūkot izejas kodu

Check if receiver avatar object is undefined (#164)

Fixes #163
Silly 9 gadi atpakaļ
vecāks
revīzija
8cf6bfbfe4
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  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);