فهرست منبع

Merge pull request #9005 from Foxhoundn/bugfix/audioEngine-undefined

Check if audioEngine exists on Engine
David Catuhe 4 سال پیش
والد
کامیت
3ff488ebe6
2فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 1 0
      dist/what's new.md
  2. 4 0
      src/Audio/audioSceneComponent.ts

+ 1 - 0
dist/what's new.md

@@ -355,6 +355,7 @@
 - Fix for bug where frames without comments would display undefined at the bottom right corner ([Kyle Belfort](https://github.com/belfortk))
 - Fixed an issue in XR where one of the cameras used for rendering got the wrong framebuffer dimensions ([RaananW](https://github.com/RaananW/))
 - Fix bug in `StandardMaterial` and `PBRMaterial` where the mesh visibility value is not applied correctly when the material is frozen ([Popov72](https://github.com/Popov72))
+- Fix a bug where the engine would crash if `audioEngine` did not exist on `Engine`
 
 ## Breaking changes
 

+ 4 - 0
src/Audio/audioSceneComponent.ts

@@ -496,6 +496,10 @@ export class AudioSceneComponent implements ISceneSerializableComponent {
 
         var audioEngine = Engine.audioEngine;
 
+        if (!audioEngine) {
+            return;
+        }
+
         if (audioEngine.audioContext) {
             // A custom listener position provider was set
             // Use the users provided position instead of camera's