[Voice] fix checklocale with RuleHumanLanguageInterpreter (#2813)

Check for  emptyness and not for null. No service returns null.
But RuleHumanLanguageInterpreter returns an empty set to tell it has no locale preference.

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
This commit is contained in:
dalgwen 2022-03-03 15:55:48 +01:00 committed by GitHub
parent b4a5cd331a
commit 7f2edc6f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -549,9 +549,8 @@ public class VoiceManagerImpl implements VoiceManager, ConfigOptionProvider {
dialogProcessors.clear();
}
private boolean checkLocales(@Nullable Set<Locale> supportedLocales, Locale locale) {
if (supportedLocales == null) {
// rule interpreter returns null so allowing it
private boolean checkLocales(Set<Locale> supportedLocales, Locale locale) {
if (supportedLocales.isEmpty()) {
return true;
}
return supportedLocales.stream().anyMatch(sLocale -> {