ChannelGroupTypeUID groupTypeUID = UidUtils.generateChannelGroupTypeUID(channel);
ChannelGroupType groupType = channelGroupTypeProvider.getInternalChannelGroupType(groupTypeUID);
if (groupType == null || device.isGatewayExtras()) {
- String groupLabel = String.format("%s",
- MiscUtils.capitalize(channel.getType().replace("_", " ")));
+ String groupLabel = String.format("%s", channel.getType() == null ? null
+ : MiscUtils.capitalize(channel.getType().replace("_", " ")));
groupType = ChannelGroupTypeBuilder.instance(groupTypeUID, groupLabel)
.withChannelDefinitions(channelDefinitions).build();
channelGroupTypeProvider.addChannelGroupType(groupType);
Number defaultValue = (Number) dp.getDefaultValue();
Number maxValue = dp.getMaxValue();
// some datapoints can have a default value that is greater than the maximum value
- if (defaultValue.doubleValue() > maxValue.doubleValue()) {
+ if (defaultValue != null && maxValue != null
+ && defaultValue.doubleValue() > maxValue.doubleValue()) {
maxValue = defaultValue;
}
builder.withMinimum(MetadataUtils.createBigDecimal(dp.getMinValue()));