Improved error handling.
This commit is contained in:
parent
d7979474af
commit
4dafa05048
1 changed files with 12 additions and 8 deletions
|
@ -37,16 +37,20 @@ class App.User extends App.Model
|
||||||
"user icon"
|
"user icon"
|
||||||
|
|
||||||
initials: ->
|
initials: ->
|
||||||
if @firstname[0] && @lastname[0]
|
if @firstname && @lastname && @firstname[0] && @lastname[0]
|
||||||
@firstname[0] + @lastname[0]
|
return @firstname[0] + @lastname[0]
|
||||||
else if @firstname[0] && !@lastname[0]
|
else if @firstname && @firstname[0] && !@lastname
|
||||||
@firstname[0] + @firstname[1]
|
if @firstname[1]
|
||||||
else if !@firstname[0] && @lastname[0]
|
return @firstname[0] + @firstname[1]
|
||||||
@lastname[0] + @lastname[1]
|
return @firstname[0]
|
||||||
|
else if !@firstname && @lastname && @lastname[0]
|
||||||
|
if @lastname[1]
|
||||||
|
return @lastname[0] + @lastname[1]
|
||||||
|
return @lastname[0]
|
||||||
else if @email
|
else if @email
|
||||||
@email[0] + @email[1]
|
return @email[0] + @email[1]
|
||||||
else
|
else
|
||||||
'??'
|
return '??'
|
||||||
|
|
||||||
avatar: (big = false, placement = '', cssClass = '') ->
|
avatar: (big = false, placement = '', cssClass = '') ->
|
||||||
if big
|
if big
|
||||||
|
|
Loading…
Reference in a new issue