From 1660d9f4169610ac0377799508bc2b85baa1d69e Mon Sep 17 00:00:00 2001 From: Kettenotter <32515271+Kettenotter@users.noreply.github.com> Date: Mon, 15 Jul 2024 23:25:34 +0200 Subject: [PATCH] Fixed Crash (#361) It was possible to crash the editor because the Audio Component had no valid owner. So I added a check for it. --- .../Source/SteamAudio/Private/SteamAudioSpatialization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudio/Private/SteamAudioSpatialization.cpp b/unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudio/Private/SteamAudioSpatialization.cpp index de76c5c1..732897ad 100644 --- a/unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudio/Private/SteamAudioSpatialization.cpp +++ b/unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudio/Private/SteamAudioSpatialization.cpp @@ -339,7 +339,7 @@ void FSteamAudioSpatializationPlugin::ProcessAudio(const FAudioPluginSourceInput // FIXME: Unreal 4.27 does not pass the audio component id correctly to the spatializer plugin. It does this // correctly for the occlusion and reverb plugins. UAudioComponent* AudioComponent = UAudioComponent::GetAudioComponentFromID(InputData.AudioComponentId); - USteamAudioSourceComponent* SteamAudioSourceComponent = (AudioComponent) ? AudioComponent->GetOwner()->FindComponentByClass() : nullptr; + USteamAudioSourceComponent* SteamAudioSourceComponent = AudioComponent && AudioComponent->GetOwner() ? AudioComponent->GetOwner()->FindComponentByClass() : nullptr; if (SteamAudioSourceComponent && FSteamAudioModule::IsPlaying()) {