fix
This commit is contained in:
@@ -69,8 +69,16 @@ class BaseLoader<T> implements ILoader<T> {
|
|||||||
if (StringTools.startsWith(url, "%assets%")) {
|
if (StringTools.startsWith(url, "%assets%")) {
|
||||||
var path:String = url.substring(9);
|
var path:String = url.substring(9);
|
||||||
var bytes:ByteArray = openfl.Assets.getBytes(path);
|
var bytes:ByteArray = openfl.Assets.getBytes(path);
|
||||||
|
if (bytes == null) {
|
||||||
|
Timer.delay(function() {
|
||||||
|
var c:ICallback<T> = callback;
|
||||||
|
dispose();
|
||||||
|
c.callFail("Bytes is null for asset: " + path);
|
||||||
|
}, 1);
|
||||||
|
} else {
|
||||||
return fromBytes(bytes);
|
return fromBytes(bytes);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#end
|
#end
|
||||||
return request(url, URLRequestMethod.GET, data);
|
return request(url, URLRequestMethod.GET, data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user