From 4dd4564537ca7aed04dd6b4b5a42e422adc78a29 Mon Sep 17 00:00:00 2001 From: Kai Kreuzer Date: Tue, 19 May 2015 15:15:47 +0200 Subject: [PATCH] Fixes potential NPE, see also https://bugs.eclipse.org/bugs/show_bug.cgi?id=467580 Signed-off-by: Kai Kreuzer --- .../org/eclipse/smarthome/core/items/GenericItem.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/items/GenericItem.java b/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/items/GenericItem.java index 4c6907ef69d..ed99820e030 100644 --- a/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/items/GenericItem.java +++ b/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/items/GenericItem.java @@ -355,10 +355,12 @@ public StateDescription getStateDescription() { @Override public StateDescription getStateDescription(Locale locale) { - for (StateDescriptionProvider stateDescriptionProvider : stateDescriptionProviders) { - StateDescription stateDescription = stateDescriptionProvider.getStateDescription(this.name, locale); - if(stateDescription != null) { - return stateDescription; + if(stateDescriptionProviders != null) { + for (StateDescriptionProvider stateDescriptionProvider : stateDescriptionProviders) { + StateDescription stateDescription = stateDescriptionProvider.getStateDescription(this.name, locale); + if(stateDescription != null) { + return stateDescription; + } } } return null;