Avoid potential NPE (#1839)

Signed-off-by: Kai Kreuzer <kai@openhab.org>
pull/1672/head
Kai Kreuzer 2020-11-19 20:13:23 +01:00 committed by GitHub
parent ddaf0d46fd
commit 5330de0473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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());