Skip to content

Commit

Permalink
Merge pull request #9639 from RocketChat/hotfix/notification
Browse files Browse the repository at this point in the history
[FIX] Desktop notification not showing when avatar came from external storage service
  • Loading branch information
rodrigok committed Feb 9, 2018
2 parents 805ca3e + 95f85ad commit b5b4a1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/rocketchat-ui/client/lib/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ this.getAvatarAsPng = function(username, cb) {
canvas.height = image.height;
const context = canvas.getContext('2d');
context.drawImage(image, 0, 0);
return cb(canvas.toDataURL('image/png'));
try {
return cb(canvas.toDataURL('image/png'));
} catch (e) {
return cb('');
}
};
return image.onerror = function() {
return cb('');
Expand Down

0 comments on commit b5b4a1f

Please sign in to comment.