Skip to content

Commit

Permalink
fix: check if user has attributes before accessing attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jul 2, 2024
1 parent ac4bb1f commit d3166c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/api/src/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const User = (clients: {
for (const user of users) {
// set the lastaccessed attribute
let date = null;
if (user['attributes']['last_accessed']) {
if (user['attributes'] && user['attributes']['last_accessed']) {
date = new Date(user['attributes']['last_accessed']*1000).toISOString()
}
usersWithGitlabIdFetch.push({
Expand Down

0 comments on commit d3166c9

Please sign in to comment.