diff --git a/zh-cn/application-dev/notification/notification-with-wantagent.md b/zh-cn/application-dev/notification/notification-with-wantagent.md index c137a122f9a0c1a9f879b90ee52344bf2febbf3c..6a725d44667ae2894ebfb044ee04ed0fb60553b9 100644 --- a/zh-cn/application-dev/notification/notification-with-wantagent.md +++ b/zh-cn/application-dev/notification/notification-with-wantagent.md @@ -83,12 +83,12 @@ ```typescript // 创建WantAgent wantAgent.getWantAgent(wantAgentInfo, (err, data) => { - if (err.code === 0) { + if (err) { console.error('[WantAgent]getWantAgent err=' + JSON.stringify(err)); - } else { - console.info('[WantAgent]getWantAgent success'); - wantAgentObj = data; + return; } + console.info('[WantAgent]getWantAgent success'); + wantAgentObj = data; }); ```