You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error:
Uncaught TypeError: Cannot read properties of null (reading 'id')
at Object.setEffectsVolume (adapter.js:6947:26)
at audio.setEffectVolume (index.js:126:24)
at proto.emit (cocos2d-js.js:42020:12)
at _Class2.emit (cocos2d-js.js:16212:7)
at _Class2._emitSlideEvent (cocos2d-js.js:30158:7)
at _Class2._handleSliderLogic (cocos2d-js.js:30154:7)
at _Class2._onTouchMoved (cocos2d-js.js:30139:9)
at proto.emit (cocos2d-js.js:42020:12)
at _doDispatchEvent (cocos2d-js.js:15347:56)
at _Class2.dispatchEvent (cocos2d-js.js:16216:9)
code:
setEffectsVolume: function setEffectsVolume(volume) {
volume = handleVolume(volume);
var musicId = this._music.id;
this._effectVolume = volume;
for (var id in _id2audio) {
var audio = _id2audio[id];
if (!audio || audio.id === musicId) continue;
audio.setVolume(volume);
}
},
Reason:
Before music initialization, i called setEffectsVolume , and then caused the Error. I found that there was an object this._music was null. and I changed the code from "this._music.id;" to "this._music.id?this._music.id:-1;", the error had dissappear.
Relevant error log output
Uncaught TypeError: Cannot read properties of null (reading 'id')
at Object.setEffectsVolume (adapter.js:6947:26)
at audio.setEffectVolume (index.js:126:24)
at proto.emit (cocos2d-js.js:42020:12)
at _Class2.emit (cocos2d-js.js:16212:7)
at _Class2._emitSlideEvent (cocos2d-js.js:30158:7)
at _Class2._handleSliderLogic (cocos2d-js.js:30154:7)
at _Class2._onTouchMoved (cocos2d-js.js:30139:9)
at proto.emit (cocos2d-js.js:42020:12)
at _doDispatchEvent (cocos2d-js.js:15347:56)
at _Class2.dispatchEvent (cocos2d-js.js:16216:9)
Cocos Creator version
2.4.12, 2.4.13
System information
taobaominigame simulator
Issue description
error:
Uncaught TypeError: Cannot read properties of null (reading 'id')
at Object.setEffectsVolume (adapter.js:6947:26)
at audio.setEffectVolume (index.js:126:24)
at proto.emit (cocos2d-js.js:42020:12)
at _Class2.emit (cocos2d-js.js:16212:7)
at _Class2._emitSlideEvent (cocos2d-js.js:30158:7)
at _Class2._handleSliderLogic (cocos2d-js.js:30154:7)
at _Class2._onTouchMoved (cocos2d-js.js:30139:9)
at proto.emit (cocos2d-js.js:42020:12)
at _doDispatchEvent (cocos2d-js.js:15347:56)
at _Class2.dispatchEvent (cocos2d-js.js:16216:9)
code:
setEffectsVolume: function setEffectsVolume(volume) {
volume = handleVolume(volume);
var musicId = this._music.id;
this._effectVolume = volume;
},
Reason:
Before music initialization, i called setEffectsVolume , and then caused the Error. I found that there was an object this._music was null. and I changed the code from "this._music.id;" to "this._music.id?this._music.id:-1;", the error had dissappear.
Relevant error log output
Steps to reproduce
1.launch application 2,slide the slider
Minimal reproduction project
audio error demo.zip
The text was updated successfully, but these errors were encountered: