Skip to content

Commit

Permalink
Fix NPE in when command output is null #187
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Feb 4, 2016
1 parent 6ac8d32 commit 5e484f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ public <T, C extends RedisCommand<K, V, T>> C write(C command) {
channelWriter = writer.defaultWriter;
}

commandToSend.getOutput().setError((String) null);
if(command.getOutput() != null){
commandToSend.getOutput().setError((String) null);
}

if (channelWriter != null && channelWriter != this && channelWriter != defaultWriter) {
return channelWriter.write((C) commandToSend);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,19 @@ public void pipelining() throws Exception {

}


@Test
public void transactions() throws Exception {

commands.multi();
commands.set(key, value);
commands.discard();

commands.multi();
commands.set(key, value);
commands.exec();
}

protected String value(int i) {
return value + "-" + i;
}
Expand Down

0 comments on commit 5e484f9

Please sign in to comment.