[smartmeter] Fix NPE while trying to get ChannelType (#10007)

Fixes #10006

Signed-off-by: Stefan Triller <github@stefantriller.de>
This commit is contained in:
Stefan Triller
2021-01-31 21:59:22 +01:00
committed by GitHub
parent 4c7f9efffa
commit f2ea947424

View File

@@ -107,6 +107,7 @@ public class SmartMeterChannelTypeProvider implements ChannelTypeProvider, Meter
* @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;
}
}