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 8d26271 commit a1f66d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public <T> RedisCommand<K, V, T> write(RedisCommand<K, V, T> command) {
channelWriter = writer.defaultWriter;
}

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

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


@Test
public void transactions() throws Exception {

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

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

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

0 comments on commit a1f66d9

Please sign in to comment.