mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-25 11:18:22 +00:00
Add defensive checks before removeChild to prevent 'Failed to execute removeChild' error when the element has already been removed from DOM. Wrap URL.revokeObjectURL in finally block to ensure proper resource cleanup.
This commit is contained in:
parent
6ae4bc588a
commit
fea585ae3d
@ -87,8 +87,13 @@ export function ResearchBlock({
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
try {
|
||||
if (a.parentNode) {
|
||||
a.parentNode.removeChild(a);
|
||||
}
|
||||
} finally {
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
}, 0);
|
||||
}, [reportId]);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user