From ad9884b9d8e1f9c23f611edeafc5d7ec0e207683 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 7 Apr 2017 09:52:51 +0800 Subject: [PATCH] Fix unit test cases --- cocos2d/core/load-pipeline/CCLoader.js | 3 +++ cocos2d/core/load-pipeline/loading-items.js | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/load-pipeline/CCLoader.js b/cocos2d/core/load-pipeline/CCLoader.js index ed0af8b7d9..93d2535794 100644 --- a/cocos2d/core/load-pipeline/CCLoader.js +++ b/cocos2d/core/load-pipeline/CCLoader.js @@ -287,6 +287,9 @@ JS.mixin(CCLoader.prototype, { _resources: resources, _getResUuid: function (url, type, quiet) { + if (!url) { + return null; + } // Ignore parameter var index = url.indexOf('?'); if (index !== -1) diff --git a/cocos2d/core/load-pipeline/loading-items.js b/cocos2d/core/load-pipeline/loading-items.js index 23d1f7899c..8c643db7d2 100644 --- a/cocos2d/core/load-pipeline/loading-items.js +++ b/cocos2d/core/load-pipeline/loading-items.js @@ -270,8 +270,13 @@ var LoadingItems = function (pipeline, urlList, onProgress, onComplete) { this.active = false; } - if (urlList && urlList.length > 0) { - this.append(urlList); + if (urlList) { + if (urlList.length > 0) { + this.append(urlList); + } + else { + this.allComplete(); + } } };