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:
parent
beefc08485
commit
43db2dadc1
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user