diff --git a/src/main/java/org/gitlab4j/api/GitLabApi.java b/src/main/java/org/gitlab4j/api/GitLabApi.java index d9cea03d7..280a99914 100644 --- a/src/main/java/org/gitlab4j/api/GitLabApi.java +++ b/src/main/java/org/gitlab4j/api/GitLabApi.java @@ -521,7 +521,7 @@ public void setSudoAsId(Integer sudoAsId) throws GitLabApiException { // Get the User specified by the sudoAsId, if you are not an admin or the username is not found, this will fail User user = getUserApi().getUser(sudoAsId); - if (user == null || user.getId() != sudoAsId) { + if (user == null || !user.getId().equals(sudoAsId)) { throw new GitLabApiException("the specified user ID was not found"); }