fix(web): guard null talent graph in collaborate share-link handler

handleCopyShareLink read graph.profile.username, but graph is TalentGraph|null.
The render-level early return does not narrow graph inside the callback closure,
so tsc reported TS18047 (possibly null) and a null graph would throw at runtime.
Optional-chain the guard so the handler no-ops until the graph has loaded.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
caelum0x 2026-09-06 12:13:48 +03:00
parent beefc08485
commit 43db2dadc1

View File

@ -178,7 +178,7 @@ export default function CollaboratePage() {
}
const handleCopyShareLink = async () => {
if (!graph.profile.username) return
if (!graph?.profile.username) return
try {
const url = new URL('/collaborate', window.location.origin)