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

@@ -350,19 +350,26 @@ public class PlaybackPreference extends Preference
{
MixerChannelConfiguration defaultConfig = MixerManager.getDefaultOutputMixer();
String configName = mPreferences.get(PREFERENCE_KEY_MIXER_CHANNEL_CONFIG, defaultConfig.toString());
for(MixerChannelConfiguration config: MixerManager.getOutputMixers())
if(defaultConfig != null)
{
if(config.toString().contentEquals(configName))
String configName = mPreferences.get(PREFERENCE_KEY_MIXER_CHANNEL_CONFIG, defaultConfig.toString());
for(MixerChannelConfiguration config: MixerManager.getOutputMixers())
{
mMixerChannelConfiguration = config;
if(config.toString().contentEquals(configName))
{
mMixerChannelConfiguration = config;
}
}
if(mMixerChannelConfiguration == null)
{
mMixerChannelConfiguration = defaultConfig;
}
}
if(mMixerChannelConfiguration == null)
else
{
mMixerChannelConfiguration = defaultConfig;
mLog.error("Error - no system audio devices available");
}
}