Skip to content

Commit

Permalink
[smartmeter] Fix NPE while trying to get ChannelType (openhab#10007)
Browse files Browse the repository at this point in the history
Fixes openhab#10006

Signed-off-by: Stefan Triller <github@stefantriller.de>
Signed-off-by: Luca Calcaterra <calcaterra.luca@gmail.com>
  • Loading branch information
t2000 authored and lucacalcaterra committed Feb 23, 2021
1 parent 7713e37 commit fe1b88f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private ChannelType getChannelType(Unit<?> unit, String obis) {
* @return The {@link ChannelTypeUID} or null.
*/
public ChannelTypeUID getChannelTypeIdForObis(String obis) {
return obisChannelMap.get(obis).getUID();
ChannelType channeltype = obisChannelMap.get(obis);
return channeltype != null ? channeltype.getUID() : null;
}
}

0 comments on commit fe1b88f

Please sign in to comment.