Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix set font failed in native #7380

Merged
merged 3 commits into from
Sep 16, 2020
Merged

Conversation

SantyWang
Copy link
Contributor

@SantyWang SantyWang commented Sep 15, 2020

Re: https://github.com/cocos-creator/2d-tasks/issues/3144

Changes:

  • fix set font failed in native platform
  • return error when load direct asset failed even assetManager.force is enabled
  • use copy if requests is array

done(err);
if (err && !task.isFinish) {
if (!cc.assetManager.force || firstTask) {
cc.error(err.message, err.stack);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该不需要打印错误吗,只要回调能返回错误就行了?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还是打印下吧,上层经常会有用户不输出 err 信息,然后也没有办法知道是哪儿错了

@@ -171,9 +170,8 @@ var utils = {
}
}
catch (e) {
err = e;
cc.error(e.message, e.stack);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里需要判断是否为 force 吗

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用,这里是查询依赖的地方,理论上是不会出错的,除非资源在网络传输过程中被第三方篡改了,如果出错了用户必须自己解决,force 也没用

@SantyWang SantyWang merged commit 1804559 into cocos:v2.4.3-release Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants