Skip to content

Commit

Permalink
Guard against case where story state is null when filtering class data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Jul 31, 2023
1 parent 994ef06 commit 2cfe24a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stories/hubbles_law/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export async function getClassDataIDsForStudent(studentID: number): Promise<numb
}));
// TODO: Remove the need for ts-ignore here
// @ts-ignore: Not sure how to add AS-ed in fields to type of the output
return state.getDataValue("class_data_students") ?? [];
return state?.getDataValue("class_data_students") ?? [];
}

async function getHubbleMeasurementsForSyncStudent(studentID: number, classID: number): Promise<HubbleMeasurement[] | null> {
Expand Down

0 comments on commit 2cfe24a

Please sign in to comment.