调用系统的扫码wx.scanCode方法,在success方法中,做分割字符串操作。let a = []; a = res.result.split("|");这一句报错导致崩溃。错误日志如下:
Cannot read property 'split' of null;at pages/my/my scan_onclick function;at api scanCode success callback function
TypeError: Cannot read property 'split' of null
at success (https://miniprogram:///pages/my/my.js:38:24)
at Function.o.<computed> (https://lib/WASubContext.js:2:1311158)
at y (https://lib/WASubContext.js:2:417494)
at v (https://lib/WASubContext.js:2:417732)
at https://lib/WASubContext.js:2:419286。
期待回复