Root cause: UserMessage.svelte accesses user.id and user.name without null checks. When viewing a shared chat as an unauthenticated viewer, user is null, causing TypeError.
Fix: Wrap ProfileImage in {#if user}, add user && guard to Name condition, add fallback for message.user when user is null.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/22750
**Author:** [@aayushbaluni](https://github.com/aayushbaluni)
**Created:** 3/17/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix/22742-shared-chats-user-null`
---
### 📝 Commits (1)
- [`76c4b12`](https://github.com/open-webui/open-webui/commit/76c4b1249353417ebf8f24b76498240b2f5e74db) fix: guard against null user in Shared Chats view (#22742)
### 📊 Changes
**1 file changed** (+11 additions, -7 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/chat/Messages/UserMessage.svelte` (+11 -7)
</details>
### 📄 Description
## Summary
Fixes #22742.
**Root cause:** UserMessage.svelte accesses user.id and user.name without null checks. When viewing a shared chat as an unauthenticated viewer, user is null, causing TypeError.
**Fix:** Wrap ProfileImage in {#if user}, add user && guard to Name condition, add fallback for message.user when user is null.
## Changes
- src/lib/components/chat/Messages/UserMessage.svelte: Added null guards
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22750
Author: @aayushbaluni
Created: 3/17/2026
Status: ❌ Closed
Base:
main← Head:fix/22742-shared-chats-user-null📝 Commits (1)
76c4b12fix: guard against null user in Shared Chats view (#22742)📊 Changes
1 file changed (+11 additions, -7 deletions)
View changed files
📝
src/lib/components/chat/Messages/UserMessage.svelte(+11 -7)📄 Description
Summary
Fixes #22742.
Root cause: UserMessage.svelte accesses user.id and user.name without null checks. When viewing a shared chat as an unauthenticated viewer, user is null, causing TypeError.
Fix: Wrap ProfileImage in {#if user}, add user && guard to Name condition, add fallback for message.user when user is null.
Changes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.