Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a07a5d9

Browse files
committed
Swallow+log exception in dom.injectPlatformView
1 parent e8af2c0 commit a07a5d9

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/web_ui/lib/src/engine/view_embedder/dom_manager.dart

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,17 @@ class DomManager {
220220
void injectPlatformView(int platformViewId) {
221221
// For now, we don't need anything fancier. If needed, this can be converted
222222
// to a PlatformViewStrategy class for each web-renderer backend?
223-
final DomElement pv = PlatformViewManager.instance.getSlottedContent(platformViewId);
224-
// If pv is already a descendant of platformViewsHost -> noop
225-
if (pv.parent == platformViewsHost) {
226-
return;
223+
try {
224+
final DomElement pv = PlatformViewManager.instance.getSlottedContent(platformViewId);
225+
// If pv is already a descendant of platformViewsHost -> noop
226+
if (pv.parent == platformViewsHost) {
227+
return;
228+
}
229+
platformViewsHost.append(pv);
230+
} catch (e) {
231+
// Do not fail, many tests expect this to not crash!
232+
domWindow.console.warn(e);
227233
}
228-
platformViewsHost.append(pv);
229234
}
230235
}
231236

0 commit comments

Comments
 (0)