Commit 3f11626d authored by 李维's avatar 李维

修复某些情况nativeUrl为undefined导致的异常

parent 666084cf
......@@ -227,10 +227,11 @@ export abstract class middleLayerBase extends cc.Component {
deepDrog(cc.find("Canvas"));
// 释放远程加载的资源
cc.assetManager.assets.forEach(item => {
if(
item.nativeUrl.indexOf(`h5template`)==-1
&& item.nativeUrl.indexOf(`dist`)==-1
&& item.nativeUrl.indexOf(`http`)>-1
if (
item.nativeUrl &&
item.nativeUrl.indexOf(`h5template`) == -1
&& item.nativeUrl.indexOf(`dist`) == -1
&& item.nativeUrl.indexOf(`http`) > -1
) {
cc.assetManager.releaseAsset(item);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment