Skip to content

Commit

Permalink
Fix NPE if device_class is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusb committed Aug 30, 2024
1 parent f02c4ad commit beca30d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void buildChannels(ListEntitiesSensorResponse rsp) {
String itemType;
ChannelType channelType;

if (sensorDeviceClass.getItemType().equals("DateTime")) {
if (sensorDeviceClass != null && "DateTime".equals(sensorDeviceClass.getItemType())) {
itemType = "DateTime";
channelType = addChannelType(rsp.getUniqueId(), rsp.getName(), itemType, Collections.emptySet(),
"%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS", Set.of("Status"), true, icon, null, null, null,
Expand Down

0 comments on commit beca30d

Please sign in to comment.