mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 19:07:30 +08:00
修复快速连续关闭界面时,有概率出现的报错问题
This commit is contained in:
@@ -170,8 +170,10 @@ export class LayerUI extends Node {
|
||||
if (release === false) this.ui_cache.set(state.config.prefab, state);
|
||||
|
||||
// 界面移出舞台
|
||||
const comp = state.node.getComponent(LayerUIElement)!;
|
||||
comp.remove(release);
|
||||
if (state.valid) {
|
||||
const comp = state.node.getComponent(LayerUIElement);
|
||||
comp && comp.remove(release);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,8 +182,8 @@ export class LayerUI extends Node {
|
||||
const state = this.ui_cache.get(prefabPath);
|
||||
if (state) {
|
||||
this.ui_cache.delete(prefabPath);
|
||||
const comp = state.node.getComponent(LayerUIElement)!;
|
||||
comp.remove(true);
|
||||
const comp = state.node.getComponent(LayerUIElement);
|
||||
comp && comp.remove(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user