Skip to content

Commit 05ae590

Browse files
afsahsyedaGMishx
authored andcommitted
fix(REST): 500 internal server error on deleting a pkg linked to a release
Signed-off-by: afsahsyeda <[email protected]>
1 parent 691eb75 commit 05ae590

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/common/src/main/java/org/eclipse/sw360/datahandler/db/PackageDatabaseHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ public RequestStatus deletePackage(String id, User user) throws SW360Exception {
377377
return RequestStatus.ACCESS_DENIED;
378378
}
379379

380-
packageRepository.remove(pkg);
381380
RequestStatus status = cleanupPackageDependentFieldsInRelease(pkg, user);
382381
if (RequestStatus.SUCCESS.equals(status)) {
382+
packageRepository.remove(pkg);
383383
databaseHandlerUtil.addChangeLogs(null, pkg, user.getEmail(), Operation.DELETE, attachmentConnector,
384384
Lists.newArrayList(), null, null);
385385
return status;

0 commit comments

Comments
 (0)