Skip to content

Commit 3995d23

Browse files
committed
fix(ui): 卸载资源前检查路径是否存在
UnloadAsset 前增加 HasAssetPath 检查,避免卸载不存在的资源路径引发异常。
1 parent d889c7c commit 3995d23

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Runtime/FairyGUIFormHelper.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ public override void ReleaseUIForm(object uiFormAsset, object uiFormInstance, ob
193193
handle.Release();
194194
}
195195

196-
m_AssetComponent.UnloadAsset(uiFormAssetPath);
196+
if (m_AssetComponent.HasAssetPath(uiFormAssetPath))
197+
{
198+
m_AssetComponent.UnloadAsset(uiFormAssetPath);
199+
}
197200
}
198201
else
199202
{

0 commit comments

Comments
 (0)