Skip to content

Commit

Permalink
fix: fix assigned causing server-side crash (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjin-lee authored Oct 4, 2024
1 parent f4c39b6 commit 507bb1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/db/daos/userDao.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const assignScenarioToUsers = async (scenarioId, newAssignees) => {
*/
const retrieveAssignedScenarioList = async (userId) => {
const user = await User.findOne({ uid: userId });
if (!user.assigned) return []; // even if list is empty, we may have groups this user is a part of.
if (!user?.assigned) return []; // even if list is empty, we may have groups this user is a part of.

const multiplayerScenarios = await Groups.find(
{ "users.email": user.email },
Expand Down

0 comments on commit 507bb1a

Please sign in to comment.