From ff370d03dbdb6db072d143692c70ca4fbcdc5f67 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 4 Jun 2021 09:37:36 +0200 Subject: [PATCH] catch errors thrown by childview mount method on add in ListView --- src/platform/web/ui/general/ListView.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platform/web/ui/general/ListView.js b/src/platform/web/ui/general/ListView.js index 3aed06eb..398774ee 100644 --- a/src/platform/web/ui/general/ListView.js +++ b/src/platform/web/ui/general/ListView.js @@ -122,7 +122,13 @@ export class ListView { this.onBeforeListChanged(); const child = this._childCreator(value); this._childInstances.splice(idx, 0, child); - insertAt(this._root, idx, child.mount(this._mountArgs)); + let node; + try { + node = child.mount(this._mountArgs); + } catch (err) { + node = errorToDOM(err); + } + insertAt(this._root, idx, node); this.onListChanged(); }