Skip to content

Commit fe634da

Browse files
committed
A null key -> bytes should return null.
1 parent 99ebfa7 commit fe634da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/net/spy/memcached/util/KeyUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class KeyUtil {
1717
*/
1818
public static byte[] getKeyBytes(String k) {
1919
try {
20-
return k.getBytes("UTF-8");
20+
return k == null ? null : k.getBytes("UTF-8");
2121
} catch (UnsupportedEncodingException e) {
2222
throw new RuntimeException(e);
2323
}

0 commit comments

Comments
 (0)