Explorar o código

Check if receiver avatar object is undefined (#164)

Fixes #163
Silly %!s(int64=9) %!d(string=hai) anos
pai
achega
8cf6bfbfe4
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/directives/avatar.ts

+ 3 - 1
src/directives/avatar.ts

@@ -56,7 +56,9 @@ export default [
                 this.getAvatar = () => {
                 this.getAvatar = () => {
                     if (this.avatarExists()) {
                     if (this.avatarExists()) {
                         return this.receiver.avatar[this.resolution];
                         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 this.receiver.avatar.low;
                     }
                     }
                     return webClientService.defaults.getAvatar(this.type, this.highResolution);
                     return webClientService.defaults.getAvatar(this.type, this.highResolution);