mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
Don't crash if no user info
This commit is contained in:
parent
9d5db86d3e
commit
3678908477
1 changed files with 5 additions and 2 deletions
|
@ -105,13 +105,16 @@ exports.getModule = class LastCallersModule extends MenuModule {
|
|||
item.ts = moment(item.timestamp).format(dateTimeFormat);
|
||||
|
||||
User.getUserName(item.userId, (err, userName) => {
|
||||
item.userName = userName;
|
||||
item.userName = userName || 'N/A';
|
||||
|
||||
User.loadProperties(item.userId, getPropOpts, (err, props) => {
|
||||
if(!err) {
|
||||
item.location = props.location;
|
||||
item.affiliation = item.affils = props.affiliation;
|
||||
}
|
||||
} else {
|
||||
item.location = 'N/A';
|
||||
item.affiliation = 'N/A';
|
||||
}
|
||||
return next();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue