{"action":"closed","issue":{"url":"https://api.github.com/repos/xetorthio/jedis/issues/858","labels_url":"https://api.github.com/repos/xetorthio/jedis/issues/858/labels{/name}","comments_url":"https://api.github.com/repos/xetorthio/jedis/issues/858/comments","events_url":"https://api.github.com/repos/xetorthio/jedis/issues/858/events","html_url":"https://github.com/xetorthio/jedis/issues/858","id":54554760,"number":858,"title":"NullPointerException in smembers()","user":{"login":"kennethjor","id":289163,"avatar_url":"https://avatars.githubusercontent.com/u/289163?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethjor","html_url":"https://github.com/kennethjor","followers_url":"https://api.github.com/users/kennethjor/followers","following_url":"https://api.github.com/users/kennethjor/following{/other_user}","gists_url":"https://api.github.com/users/kennethjor/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethjor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethjor/subscriptions","organizations_url":"https://api.github.com/users/kennethjor/orgs","repos_url":"https://api.github.com/users/kennethjor/repos","events_url":"https://api.github.com/users/kennethjor/events{/privacy}","received_events_url":"https://api.github.com/users/kennethjor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-01-16T09:20:21Z","updated_at":"2015-02-03T17:04:47Z","closed_at":"2015-02-03T17:04:47Z","body":"Today I've noticed quite a few of these exceptions being logged on our servers:\r\n\r\n```\r\nCaused by: java.lang.NullPointerException\r\n        at java.util.HashSet.<init>(HashSet.java:118)\r\n        at redis.clients.jedis.Jedis.smembers(Jedis.java:1206)\r\n        [...]\r\n```\r\n\r\nI have tried to reproduce it locally, but was unable to. However, it seems this could be fixed by adding a null check just before `return new HashSet<String>(members);` in `smembers()`:\r\n\r\n```java\r\n  public Set<String> smembers(final String key) {\r\n    checkIsInMulti();\r\n    client.smembers(key);\r\n    final List<String> members = client.getMultiBulkReply();\r\n    return new HashSet<String>(members);\r\n  }\r\n```\r\n\r\nThis was noticed in version 2.6.5 on Jedis running against Redis 2.8.4."}}