fix: Undefined method `length' for nil:NilClass (#8491)

This commit is contained in:
Sivin Varghese
2023-12-05 16:34:29 +05:30
committed by GitHub
parent c1ac354c9b
commit 17faa6c3b2
2 changed files with 3 additions and 1 deletions

View File

@@ -64,6 +64,8 @@ module PortalHelper
def thumbnail_bg_color(username)
colors = ['#6D95BA', '#A4C3C3', '#E19191']
return colors.sample if username.blank?
colors[username.length % colors.size]
end
end