mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
fix: addChildView() crashes when adding a closed WebContentsView (#47099)
fix: addChildView() crashes when add a closed WebContentsView
This commit is contained in:
@@ -216,6 +216,12 @@ void View::AddChildViewAt(gin::Handle<View> child,
|
||||
if (!view_)
|
||||
return;
|
||||
|
||||
if (!child->view()) {
|
||||
gin_helper::ErrorThrower(isolate()).ThrowError(
|
||||
"Can't add a destroyed child view to a parent view");
|
||||
return;
|
||||
}
|
||||
|
||||
// This will CHECK and crash in View::AddChildViewAtImpl if not handled here.
|
||||
if (view_ == child->view()) {
|
||||
gin_helper::ErrorThrower(isolate()).ThrowError(
|
||||
|
||||
Reference in New Issue
Block a user