From 7f2edc6f933277d220cc0f5cc6180730ecc3db7f Mon Sep 17 00:00:00 2001 From: dalgwen Date: Thu, 3 Mar 2022 15:55:48 +0100 Subject: [PATCH] [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 --- .../org/openhab/core/voice/internal/VoiceManagerImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/internal/VoiceManagerImpl.java b/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/internal/VoiceManagerImpl.java index 64c16a1f42..94bd72c60b 100644 --- a/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/internal/VoiceManagerImpl.java +++ b/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/internal/VoiceManagerImpl.java @@ -549,9 +549,8 @@ public class VoiceManagerImpl implements VoiceManager, ConfigOptionProvider { dialogProcessors.clear(); } - private boolean checkLocales(@Nullable Set supportedLocales, Locale locale) { - if (supportedLocales == null) { - // rule interpreter returns null so allowing it + private boolean checkLocales(Set supportedLocales, Locale locale) { + if (supportedLocales.isEmpty()) { return true; } return supportedLocales.stream().anyMatch(sLocale -> {