Problem
Sentry Issue: ELECTRON-C6 (3 occurrences, last seen 2026-03-25)
TypeError: Cannot read properties of null (reading 'addInstance') thrown from handleOpenInSystem in PreviewPanel.tsx:384.
Root Cause
Arco Design's Message.useMessage() hook stores a ref to the context holder component. When handleOpenInSystem calls await ipcBridge.shell.openFile.invoke() and the IPC call rejects, the preview panel may have already unmounted, making contextHolderRef.current null. The subsequent messageApi.error() call then crashes with the TypeError.
Stack Trace
PreviewPanel.tsx:384 (handleOpenInSystem) → messageApi.error()
useMessage.js:66 → addNotice()
useMessage.js:53 → contextHolderRef.current.addInstance(notice) // null!
Fix
Wrap messageApi calls in handleOpenInSystem with try-catch to gracefully handle the unmounted context holder case.
Affected Versions
Problem
Sentry Issue: ELECTRON-C6 (3 occurrences, last seen 2026-03-25)
TypeError: Cannot read properties of null (reading 'addInstance')thrown fromhandleOpenInSysteminPreviewPanel.tsx:384.Root Cause
Arco Design's
Message.useMessage()hook stores a ref to the context holder component. WhenhandleOpenInSystemcallsawait ipcBridge.shell.openFile.invoke()and the IPC call rejects, the preview panel may have already unmounted, makingcontextHolderRef.currentnull. The subsequentmessageApi.error()call then crashes with the TypeError.Stack Trace
Fix
Wrap
messageApicalls inhandleOpenInSystemwith try-catch to gracefully handle the unmounted context holder case.Affected Versions