mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Avoid potential NPE (#1839)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
+2
-1
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user