Skip to content

Commit

Permalink
Merge pull request #1011 from newrelic/jedis-fix
Browse files Browse the repository at this point in the history
Prevent ArrayIndexOutOfBoundsException
  • Loading branch information
jasonjkeller authored Sep 19, 2022
2 parents b3c2b3b + b9faa66 commit 16840a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ public void disconnect() {
@Trace(leaf = true)
public void sendCommand(final ProtocolCommand cmd, final byte[]... args) {
Weaver.callOriginal();

updateDbIndex(cmd, new String(args[0], StandardCharsets.UTF_8));
if (args != null && args.length > 0) {
updateDbIndex(cmd, new String(args[0], StandardCharsets.UTF_8));
}
reportMethodAsExternal(cmd, getHost(), getPort());
}

@Trace(leaf = true)
public void sendCommand(final ProtocolCommand cmd, final String... args) {
Weaver.callOriginal();

updateDbIndex(cmd, args[0]);
if (args != null && args.length > 0) {
updateDbIndex(cmd, args[0]);
}
reportMethodAsExternal(cmd, getHost(), getPort());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ public void disconnect() {
@Trace
public void sendCommand(final ProtocolCommand cmd, final byte[]... args) {
Weaver.callOriginal();

updateDbIndex(cmd, new String(args[0], StandardCharsets.UTF_8));

if (args != null && args.length > 0) {
updateDbIndex(cmd, new String(args[0], StandardCharsets.UTF_8));
}
}

@Trace
public void sendCommand(final ProtocolCommand cmd, final String... args) {
Weaver.callOriginal();

updateDbIndex(cmd, args[0]);
if (args != null && args.length > 0) {
updateDbIndex(cmd, args[0]);
}
}

@Trace(leaf = true)
Expand Down

0 comments on commit 16840a8

Please sign in to comment.