Commit 78d599c2 authored by Tim Olshansky's avatar Tim Olshansky Committed by GitHub

Merge pull request #154 from iwarapter/master

handle NPE when calling GitlabGroup.getLdapAccess()
parents 1040100a a29f0df7
......@@ -49,6 +49,9 @@ public class GitlabGroup {
}
public GitlabAccessLevel getLdapAccess() {
if (ldapAccess == null) {
return null;
}
return GitlabAccessLevel.fromAccessValue(ldapAccess);
}
......
......@@ -2,6 +2,8 @@ package org.gitlab.api.models;
import org.junit.Test;
import static org.junit.Assert.assertNull;
/**
* Tests for {@link GitlabGroup}
*/
......@@ -13,4 +15,10 @@ public class GitlabGroupTest {
group.setLdapAccess(null);
}
@Test
public void getLdapAccessHandlesNull() {
GitlabGroup group = new GitlabGroup();
group.setLdapAccess(null);
assertNull( group.getLdapAccess() );
}
}
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