FIX: blank avatar on user card if flair url is undefined (#12791)

FIX: blank avatar on user card if flair url is undefined (#12791)

If creating a group avatar flair with no icon or image, the user card was showing a blank circle.

diff --git a/app/assets/javascripts/discourse/app/components/user-avatar-flair.js b/app/assets/javascripts/discourse/app/components/user-avatar-flair.js
index 21464ba..faf7492 100644
--- a/app/assets/javascripts/discourse/app/components/user-avatar-flair.js
+++ b/app/assets/javascripts/discourse/app/components/user-avatar-flair.js
@@ -15,7 +15,10 @@ export default MountWidget.extend({
       return;
     }
 
-    if (this.user.primary_group_flair_url) {
+    if (
+      this.user.primary_group_flair_url ||
+      this.user.primary_group_flair_bg_color
+    ) {
       return {
         primary_group_flair_url: this.user.primary_group_flair_url,
         primary_group_flair_bg_color: this.user.primary_group_flair_bg_color,

GitHub sha: f186ff99

1 Like

This commit appears in #12791 which was approved by tshenry. It was merged by nlalonde.