diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java index 51770bcde..46935afaf 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java @@ -52,6 +52,7 @@ import org.springframework.cloud.bus.ServiceMatcher; import org.springframework.cloud.bus.event.RemoteApplicationEvent; import org.springframework.context.event.EventListener; import org.springframework.data.domain.PageRequest; +import org.springframework.util.CollectionUtils; import com.google.common.collect.Maps; @@ -278,7 +279,10 @@ public class AmqpMessageDispatcherService extends BaseAmqpService { amqpSoftwareModule.setModuleType(entry.getKey().getType().getKey()); amqpSoftwareModule.setModuleVersion(entry.getKey().getVersion()); amqpSoftwareModule.setArtifacts(convertArtifacts(target, entry.getKey().getArtifacts())); - amqpSoftwareModule.setMetadata(convertMetadata(entry.getValue())); + + if (!CollectionUtils.isEmpty(entry.getValue())) { + amqpSoftwareModule.setMetadata(convertMetadata(entry.getValue())); + } return amqpSoftwareModule; } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/resources/db/migration/H2/V1_12_2__missing_non_null_enum___H2.sql b/hawkbit-repository/hawkbit-repository-jpa/src/main/resources/db/migration/H2/V1_12_2__missing_non_null_enum___H2.sql new file mode 100644 index 000000000..5a7755373 --- /dev/null +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/resources/db/migration/H2/V1_12_2__missing_non_null_enum___H2.sql @@ -0,0 +1,3 @@ +ALTER TABLE sp_target CHANGE COLUMN update_status update_status integer not null; +ALTER TABLE sp_rollout CHANGE COLUMN action_type action_type integer not null; +ALTER TABLE sp_action CHANGE COLUMN action_type action_type integer not null; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/resources/db/migration/MYSQL/V1_12_2__missing_non_null_enum___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa/src/main/resources/db/migration/MYSQL/V1_12_2__missing_non_null_enum___MYSQL.sql new file mode 100644 index 000000000..5a7755373 --- /dev/null +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/resources/db/migration/MYSQL/V1_12_2__missing_non_null_enum___MYSQL.sql @@ -0,0 +1,3 @@ +ALTER TABLE sp_target CHANGE COLUMN update_status update_status integer not null; +ALTER TABLE sp_rollout CHANGE COLUMN action_type action_type integer not null; +ALTER TABLE sp_action CHANGE COLUMN action_type action_type integer not null; \ No newline at end of file