mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-13 21:57:30 +08:00
fix: prevent crash when switching between agent and assistant (#12252)
This commit is contained in:
parent
ca2b0ac28d
commit
2a3955919e
@ -96,7 +96,7 @@ export const TopicManagePanel: React.FC<TopicManagePanelProps> = ({
|
||||
// Topics that can be selected (non-pinned, and filtered when in search mode)
|
||||
const selectableTopics = useMemo(() => {
|
||||
const baseTopics = isSearchMode ? filteredTopics : assistant.topics
|
||||
return baseTopics.filter((topic) => !topic.pinned)
|
||||
return (baseTopics ?? []).filter((topic) => !topic.pinned)
|
||||
}, [assistant.topics, filteredTopics, isSearchMode])
|
||||
|
||||
// Check if all selectable topics are selected
|
||||
|
||||
Loading…
Reference in New Issue
Block a user