summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-06 14:19:40 +0100
committerGitHub <noreply@github.com>2021-12-06 14:19:40 +0100
commitede7614fe2e088f9ece1e1aba5cb3d5fceb476e4 (patch)
tree11186f4ee1008367fcbb79d862b5e39ceeb74f89 /scene/3d
parent1f5a3ba0bae8f0bf7012028c999b999e7c00d087 (diff)
parent601a0722a7340f14c85fcf7eec372961c8b542b7 (diff)
Merge pull request #55544 from V-Sekai/audio_camera_null_mitigation
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/audio_stream_player_3d.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index efe23c6102..bdcab49e4e 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -391,7 +391,13 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() {
PhysicsDirectSpaceState3D *space_state = PhysicsServer3D::get_singleton()->space_get_direct_state(world_3d->get_space());
for (Camera3D *camera : cameras) {
+ if (!camera) {
+ continue;
+ }
Viewport *vp = camera->get_viewport();
+ if (!vp) {
+ continue;
+ }
if (!vp->is_audio_listener_3d()) {
continue;
}