mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 21:31:53 +01:00
[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:
parent
b4a5cd331a
commit
7f2edc6f93
@ -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 -> {
|
||||
|
Loading…
Reference in New Issue
Block a user