Browse Source

fix(solutions): invert empty-check guard in deleteSolution

The guard around iterating createdEntityIds was checking isEmpty()
instead of !isEmpty(), so entity deletion was skipped whenever there
was actually data to clean up.
pull/15539/head
Igor Kulikov 1 month ago
parent
commit
d68d89d26e
  1. 2
      application/src/main/java/org/thingsboard/server/service/solutions/DefaultSolutionService.java

2
application/src/main/java/org/thingsboard/server/service/solutions/DefaultSolutionService.java

@ -248,7 +248,7 @@ public class DefaultSolutionService implements SolutionService {
@Override
public void deleteSolution(TenantId tenantId, SolutionTemplateInstalledItemDescriptor descriptor, SecurityUser user) throws ThingsboardException {
try {
if (descriptor.getCreatedEntityIds() != null && descriptor.getCreatedEntityIds().isEmpty()) {
if (descriptor.getCreatedEntityIds() != null && !descriptor.getCreatedEntityIds().isEmpty()) {
List<EntityId> entityIds = new ArrayList<>(descriptor.getCreatedEntityIds());
// Delete in the descending order of creation to avoid dependency issues.
Collections.reverse(entityIds);

Loading…
Cancel
Save