From 7916ec6074d556c83af108b25f06700af9df3bc7 Mon Sep 17 00:00:00 2001 From: Courtney Robertson Date: Mon, 24 Aug 2026 10:21:16 -0400 Subject: [PATCH] don't crash on the first post of a user created by /localnewuser A user created through /localnewuser has never called /saveprefs, so their prefs column is NULL and convertUser hands back a record with no prefs at all. The first post then takes the whole server down: TypeError: Cannot read properties of undefined (reading 'myFeedTitle') at buildFeedForUser (rssnetwork.js:1144) because buildFeedForUser (and getUserData) read userRec.prefs.myFeedTitle without a guard. Default prefs to an empty object in convertUser, the one place user rows are converted, so every reader sees the same shape. To reproduce on a fresh server: /localnewuser, then /newpost. With this change the post publishes and the feed builds with the fallback title. Co-Authored-By: Claude Opus 5 --- server/code/rssnetwork.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/code/rssnetwork.js b/server/code/rssnetwork.js index e2ecf7e..f674a73 100644 --- a/server/code/rssnetwork.js +++ b/server/code/rssnetwork.js @@ -475,7 +475,7 @@ var config = { imageUrl: convertString (theUser.imageUrl), //5/4/26 by DW whenCreated: convertDate (theUser.whenCreated), whenUpdated: convertDate (theUser.whenUpdated), - prefs: convertJson (theUser.prefs) //5/16/26 by DW + prefs: convertJson (theUser.prefs) || {} //5/16/26 by DW; 8/24/26 by CC -- a user who has never saved prefs has a NULL column, and callers read prefs.myFeedTitle unguarded }); } function convertItem (theItem) {