Skip to content

Commit

Permalink
Merge pull request #77 from Carifio24/null-story-state-guard
Browse files Browse the repository at this point in the history
Guard against case where story state is null when filtering class data.
  • Loading branch information
Carifio24 authored Jul 31, 2023
2 parents 994ef06 + 2cfe24a commit b2c56b5
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 b2c56b5

Please sign in to comment.