Resolves #694. Address null pointer when no system audio devices are available. (#695)

Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
Denny Sheirer
2020-03-23 08:45:06 +00:00
committed by GitHub
parent 692ffabe82
commit 41df207bb9
3 changed files with 42 additions and 14 deletions

View File

@@ -81,15 +81,23 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
MyEventBus.getEventBus().register(this);
MixerChannelConfiguration configuration = mUserPreferences.getPlaybackPreference().getMixerChannelConfiguration();
try
if(configuration != null)
{
setMixerChannelConfiguration(configuration);
try
{
setMixerChannelConfiguration(configuration);
}
catch(AudioException ae)
{
mLog.error("Error during setup of audio playback configuration. Attempted to use audio mixer [" +
(configuration != null ? configuration.getMixer().toString() : "null") + "] and channel [" +
(configuration != null ? configuration.getMixerChannel().name() : "null") + "]", ae);
}
}
catch(AudioException ae)
else
{
mLog.error("Error during setup of audio playback configuration. Attempted to use audio mixer [" +
(configuration != null ? configuration.getMixer().toString() : "null") + "] and channel [" +
(configuration != null ? configuration.getMixerChannel().name() : "null") + "]", ae);
mLog.warn("No audio output devices available");
}
}