mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
catch errors thrown by childview mount method on add in ListView
This commit is contained in:
parent
05cc1f6757
commit
ff370d03db
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user