fix(app): handle null session in ChatList ListFooter (#494)#562
Open
xoverride wants to merge 2 commits intoslopus:mainfrom
Open
fix(app): handle null session in ChatList ListFooter (#494)#562xoverride wants to merge 2 commits intoslopus:mainfrom
xoverride wants to merge 2 commits intoslopus:mainfrom
Conversation
The ListFooter component used a non-null assertion on useSession() which can return null during initial render or timing issues. This caused "undefined is not a function" crash when accessing session.agentState. Fix: Add null check and return null if session not loaded yet. Closes slopus#494
Fixes slopus#494 - "undefined is not a function" crash on iOS The ToolHeader component was calling knownTool.icon() after only checking if the property was truthy, without verifying it was actually a function. This could cause a crash if the icon property existed but was not callable. Changed from: knownTool?.icon ? knownTool.icon(...) : fallback To: knownTool && typeof knownTool.icon === 'function' ? knownTool.icon(...) : fallback This matches the defensive pattern already used in ToolView.tsx (lines 110-112) for the same purpose.
leeroybrun
added a commit
to happier-dev/happier
that referenced
this pull request
Feb 14, 2026
This comment was marked as abuse.
This comment was marked as abuse.
cjunxiang
reviewed
Feb 27, 2026
Comment on lines
+31
to
+33
| if (!session) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
thanks for adding the null checks, there is a lack of general null safety that breaks constantly. hope maintainers expedite the reviews on these critical ones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #494 - App crashes with "undefined is not a function" when accessing a session.
Root Cause
The
ListFootercomponent inChatList.tsxused a non-null assertion (!) onuseSession():useSession()returnsSession | null. During initial render or timing issues, it can returnnull. Accessingsession.agentStateon null causes the crash.Fix
Added proper null handling:
Test plan
useSession()!pattern in the codebase