From b3caaf61f348ce009cf0c01e246b3102bd8ee17f Mon Sep 17 00:00:00 2001 From: aamoghS Date: Sat, 8 Aug 2026 22:15:20 -0700 Subject: [PATCH] fix(portal): a blank graduation year no longer blocks saving the profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Membership tab refused to save anything — school, major, skills, interests, socials — unless a graduation year had been typed in, and the error it showed ("That graduation year does not look right") pointed at a field the member had deliberately left empty. The guard compared against `undefined` while the value is `null` for a blank field: `null !== undefined` is true and `Number.isInteger(null)` is false, so every save with an empty year fell into the error branch. `null` is the value that CLEARS the column, so it has to pass. Introduced by the review fix on #323, which changed the payload from `undefined` to `null` to make fields clearable and did not move the guard with it. Found while auditing the product against MVP. --- sites/mainweb/components/portal/MembershipTab.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sites/mainweb/components/portal/MembershipTab.tsx b/sites/mainweb/components/portal/MembershipTab.tsx index e18f5a1c..9940a6d5 100644 --- a/sites/mainweb/components/portal/MembershipTab.tsx +++ b/sites/mainweb/components/portal/MembershipTab.tsx @@ -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; }