Skip to content

Commit

Permalink
[HWORKS-883] Fix Sonarqube issues in CommandsController (#1634) (#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
gibchikafa authored Dec 11, 2023
1 parent 47d0d58 commit fc03e28
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ public void deleteCommands(Project project) {
public void deleteCommand(Project project, Integer commandId) throws PythonException {
CondaCommands command = condaCommandFacade.getCommandsForProject(project)
.stream()
.filter(cc -> cc.getId() == commandId).findFirst().orElseThrow(() ->
.filter(cc -> cc.getId().equals(commandId)).findFirst().orElseThrow(() ->
new PythonException(RESTCodes.PythonErrorCode.CONDA_COMMAND_NOT_FOUND,
Level.FINE, "Conda command with Id " + commandId + " not found"));
if (command.getStatus().isRunning()) {
new PythonException(RESTCodes.PythonErrorCode.CONDA_COMMAND_DELETE_ERROR,
throw new PythonException(RESTCodes.PythonErrorCode.CONDA_COMMAND_DELETE_ERROR,
Level.FINE, "Cannot delete command: command is already in running state.");
}
if (CondaOp.isEnvOp(command.getOp())) {
Expand Down

0 comments on commit fc03e28

Please sign in to comment.