Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sites/mainweb/components/portal/MembershipTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ export function MembershipTab() {
const save = () => {
setError(null);

// `null` is a graduation year that was left blank, which is allowed and is
// what clears the column. The guard compared against `undefined` instead,
// so `Number.isInteger(null)` failed it and the whole form refused to save
// — school, skills, socials and all — until a year was typed in.
const year = form.graduationYear.trim()
? Number(form.graduationYear)
: null;
if (year !== undefined && !Number.isInteger(year)) {
if (year !== null && !Number.isInteger(year)) {
setError("That graduation year does not look right.");
return;
}
Expand Down