diff --git a/app/components/Sidebar/components/StarredLink.tsx b/app/components/Sidebar/components/StarredLink.tsx index 335170206d..be0fc7645d 100644 --- a/app/components/Sidebar/components/StarredLink.tsx +++ b/app/components/Sidebar/components/StarredLink.tsx @@ -38,10 +38,10 @@ function StarredLink({ star }: Props) { const { ui, collections, documents } = useStores(); const [menuOpen, handleMenuOpen, handleMenuClose] = useBoolean(); const { documentId, collectionId } = star; - const collection = collections.get(collectionId); + const collection = collectionId ? collections.get(collectionId) : undefined; const locationSidebarContext = useLocationSidebarContext(); const sidebarContext = starredSidebarContext( - star.documentId ?? star.collectionId + star.documentId ?? star.collectionId ?? "" ); const [expanded, setExpanded] = useState( (star.documentId diff --git a/app/models/Star.ts b/app/models/Star.ts index 347f6385b0..4c6c76651d 100644 --- a/app/models/Star.ts +++ b/app/models/Star.ts @@ -22,7 +22,7 @@ class Star extends Model { document?: Document; /** The collection ID that is starred. */ - collectionId: string; + collectionId?: string; /** The collection that is starred. */ @Relation(() => Collection, { onDelete: "cascade" })