mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Handle undefined datetime values
Closes #3288 - Check for undefined last_login and created_at values that occur on a User model for an invited user.
This commit is contained in:
parent
3027c9fcdc
commit
6e32b9abe2
@ -33,11 +33,16 @@ var SettingsUserController = Ember.ObjectController.extend({
|
||||
}.property('user.image'),
|
||||
|
||||
last_login: function () {
|
||||
return this.get('user.last_login').fromNow();
|
||||
var lastLogin = this.get('user.last_login');
|
||||
|
||||
return lastLogin ? lastLogin.fromNow() : '';
|
||||
|
||||
}.property('user.last_login'),
|
||||
|
||||
created_at: function () {
|
||||
return this.get('user.created_at').fromNow();
|
||||
var createdAt = this.get('user.created_at');
|
||||
|
||||
return createdAt ? createdAt.fromNow() : '';
|
||||
}.property('user.created_at'),
|
||||
|
||||
actions: {
|
||||
@ -108,7 +113,6 @@ var SettingsUserController = Ember.ObjectController.extend({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
export default SettingsUserController;
|
||||
|
Loading…
Reference in New Issue
Block a user