Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

NPE in KeyValueClient.getValuesAsString() #194

Closed
lbertrand opened this issue Dec 14, 2016 · 2 comments
Closed

NPE in KeyValueClient.getValuesAsString() #194

lbertrand opened this issue Dec 14, 2016 · 2 comments

Comments

@lbertrand
Copy link

lbertrand commented Dec 14, 2016

If this method is called with a non existing key, a NPE is thrown, instead of the method returning an empty list

Simple unit test

public class SimpleTest {
    @Test
    public void testNPE() {
        Consul consul = Consul.newClient();
        List<String> shouldBeEmpty = consul.keyValueClient().getValuesAsString("unknownKey");
        assertTrue(shouldBeEmpty.isEmpty());     
    }
}
@rickfast
Copy link
Owner

Thanks for providing a unit test. I'll see if I can get to this next week.

@rickfast
Copy link
Owner

fixed by ec0f9ac

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants