Skip to content

Commit

Permalink
Avoid potential NPE (#1839)
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer committed Nov 19, 2020
1 parent ddaf0d4 commit 5330de0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ private void dispatchBindingsPerItemType(@Nullable BindingConfigReader reader, S
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());
Expand Down

0 comments on commit 5330de0

Please sign in to comment.