diff --git a/packages/fineui/src/core/4.widget.js b/packages/fineui/src/core/4.widget.js index 8fe60098a..9bf69e4a3 100644 --- a/packages/fineui/src/core/4.widget.js +++ b/packages/fineui/src/core/4.widget.js @@ -240,11 +240,9 @@ export class Widget extends OB { ).call(this, render); if (beforeRenderResult instanceof Promise) { beforeRenderResult.then(render).catch((e) => { - if (!this.isDestroyed()) { - render(); // 异步render,组件此时可能已经被销毁 - } else { - _global.console && console.error(e, 'Async render error! Widget has been destroyed!'); - } + _global.console && console.error(e); + // 异步render,组件此时可能已经被销毁 + !this.isDestroyed() ? render() : _global.console && console.error('Async render error! Widget has been destroyed!'); }); } } else { @@ -260,11 +258,9 @@ export class Widget extends OB { ).call(this, init); if (beforeInitResult instanceof Promise) { beforeInitResult.then(init).catch((e) => { - if (!this.isDestroyed()) { - init(); // 异步init,组件此时可能已经被销毁 - } else { - _global.console && console.error(e, 'Async init error! Widget has been destroyed!'); - } + _global.console && console.error(e); + // 异步init,组件此时可能已经被销毁 + !this.isDestroyed() ? init() : _global.console && console.error('Async init error! Widget has been destroyed!'); }); } } else {