复制官方用例hittest时,为何会出现一些偶现的问题

NewProject_7.zip (755.3 KB)如图,我把官方用例hittest的代码copy到自己的项目上,但调试时偶尔会出现如下报错。
官方用例不会报错,但我复制的代码却时不时的报出如下错误。

工程文件已上传,哪位同学帮忙看看吧,感觉不尽

Simulator: E/jswrapper (271): ERROR: Uncaught TypeError: Cannot read property ‘world’ of null, location: assets/hittest.js:0:0
2
STACK:
[0]anonymous@assets/hittest.js:47
[1]172.CallbacksInvoker.invoke@src/cocos2d-jsb.js:28503
[2]_doDispatchEvent@src/cocos2d-jsb.js:7679
[3]dispatchEvent@src/cocos2d-jsb.js:8324
[4]_touchStartHandler@src/cocos2d-jsb.js:7553
[5]_onTouchEventCallback@src/cocos2d-jsb.js:19634
[6]_dispatchEventToListeners@src/cocos2d-jsb.js:19724
[7]_dispatchTouchEvent@src/cocos2d-jsb.js:19673
[8]dispatchEvent@src/cocos2d-jsb.js:19946
[9]handleTouchesBegin@src/cocos2d-jsb.js:26508
[10]selfPointer._mousePressed@src/cocos2d-jsb.js:26707
[11]anonymous@src/cocos2d-jsb.js:26731
[12]dispatchEvent@jsb-adapter/jsb-builtin.js:2805
[13]anonymous@jsb-adapter/jsb-builtin.js:2876
E/jswrapper (534): [ERROR] (…\cocos\scripting\js-bindings\jswrapper\v8\Object.cpp, 534): Invoking function (177968E8) failed!
at HTMLElement.print-simulator-log (E:\CocosCreator\resources\app.asar\editor\builtin\scene\panel\messages\scene.js:1:1501)
at Object.e._dispatch (E:\CocosCreator\resources\app.asar\editor-framework\lib\renderer\panel.js:1:1941)
at EventEmitter.o.on.s (E:\CocosCreator\resources\app.asar\editor-framework\lib\renderer\ipc.js:1:2917)
at emitMany (events.js:127:13)
at EventEmitter.emit (events.js:204:7)