From 4b02ba5e4b14aa62ca34fa8d70e4f016579e5392 Mon Sep 17 00:00:00 2001 From: Sam! Bonfante <6620407+X-sam@users.noreply.github.com> Date: Sat, 17 Sep 2022 18:20:49 -0400 Subject: [PATCH] Catch null pointer exception NPE was occurring in setPosition where parent.buffer was undefined. --- src/lime/_internal/backend/html5/HTML5AudioSource.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lime/_internal/backend/html5/HTML5AudioSource.hx b/src/lime/_internal/backend/html5/HTML5AudioSource.hx index 3c7e314f6..3f3e2ba08 100644 --- a/src/lime/_internal/backend/html5/HTML5AudioSource.hx +++ b/src/lime/_internal/backend/html5/HTML5AudioSource.hx @@ -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