Avoid potential NPE (#1839)

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer
2020-11-19 20:13:23 +01:00
committed by GitHub
parent ddaf0d46fd
commit 5330de0473
@@ -300,7 +300,8 @@ public class GenericItemProvider extends AbstractProvider<Item>
if (model != null) {
for (ModelItem modelItem : model.getItems()) {
for (String itemType : itemTypes) {
if (itemType.equals(ItemUtil.getMainItemType(modelItem.getType()))) {
String type = modelItem.getType();
if (type != null && itemType.equals(ItemUtil.getMainItemType(type))) {
Item item = createItemFromModelItem(modelItem);
if (item != null) {
internalDispatchBindings(reader, modelName, item, modelItem.getBindings());