Catch null pointer exception

NPE was occurring in setPosition where parent.buffer was undefined.
This commit is contained in:
Sam! Bonfante
2022-09-17 18:20:49 -04:00
committed by GitHub
parent f9827cf47e
commit 4b02ba5e4b

View File

@@ -246,7 +246,7 @@ class HTML5AudioSource
position.w = value.w;
#if lime_howlerjs
if (parent.buffer.__srcHowl != null && parent.buffer.__srcHowl.pos != null) parent.buffer.__srcHowl.pos(position.x, position.y, position.z, id);
if (parent.buffer !=null && parent.buffer.__srcHowl != null && parent.buffer.__srcHowl.pos != null) parent.buffer.__srcHowl.pos(position.x, position.y, position.z, id);
// There are more settings to the position of the sound on the "pannerAttr()" function of howler. Maybe somebody who understands sound should look into it?
#end