Commit 8f40c65c authored by Andrew Hoffmann's avatar Andrew Hoffmann

Added a null check to GitlabGroup#setLdapAccess. This resolves a...

Added a null check to GitlabGroup#setLdapAccess. This resolves a NullPointerException that was encountered when unmarshalling a a GitlabGroup JSON object with a null ldap_access attribute.
parent e33831a4
......@@ -53,6 +53,8 @@ public class GitlabGroup {
}
public void setLdapAccess(GitlabAccessLevel ldapGitlabAccessLevel) {
this.ldapAccess = ldapGitlabAccessLevel.accessValue;
if (ldapGitlabAccessLevel != null) {
this.ldapAccess = ldapGitlabAccessLevel.accessValue;
}
}
}
package org.gitlab.api.models;
import org.junit.Test;
/**
* Tests for {@link GitlabGroup}
*/
public class GitlabGroupTest {
@Test
public void setLdapAccessHandlesNull() {
GitlabGroup group = new GitlabGroup();
group.setLdapAccess(null);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment