Skip to content

Commit

Permalink
fix(Switching): Possible crash when trying to switch audio of process…
Browse files Browse the repository at this point in the history
… that just closed.

Fixes SOUNDSWITCH-C4
Fixes SOUNDSWITCH-C3
  • Loading branch information
Belphemur committed Jun 26, 2022
1 parent 1bd6c28 commit d4894a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SoundSwitch.Audio.Manager/AudioSwitcher.cs
Expand Up @@ -114,6 +114,11 @@ public void SwitchProcessTo(string deviceId, ERole role, EDataFlow flow, uint pr
var process = Process.GetProcessById((int)processId);
processName = process.ProcessName;
}
catch (InvalidOperationException e)
{
Trace.TraceInformation($"Attempt to switch [{processId}] but got exception: {e}");
return;
}
catch (Exception e)
{
Trace.TraceError($"Can't get process info: {e}");
Expand Down

0 comments on commit d4894a0

Please sign in to comment.