Skip to content

Commit

Permalink
Fixed Crash (#361)
Browse files Browse the repository at this point in the history
It was possible to crash the editor because the Audio Component had no valid owner. So I added a check for it.
  • Loading branch information
Kettenotter authored Jul 15, 2024
1 parent 9eeb450 commit 1660d9f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<USteamAudioSourceComponent>() : nullptr;
USteamAudioSourceComponent* SteamAudioSourceComponent = AudioComponent && AudioComponent->GetOwner() ? AudioComponent->GetOwner()->FindComponentByClass<USteamAudioSourceComponent>() : nullptr;

if (SteamAudioSourceComponent && FSteamAudioModule::IsPlaying())
{
Expand Down

0 comments on commit 1660d9f

Please sign in to comment.