diff options
-rw-r--r-- | src/main/java/com/orbekk/protobuf/RpcChannel.java | 4 | ||||
-rw-r--r-- | src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/orbekk/protobuf/RpcChannel.java b/src/main/java/com/orbekk/protobuf/RpcChannel.java index 9c52651..594cff8 100644 --- a/src/main/java/com/orbekk/protobuf/RpcChannel.java +++ b/src/main/java/com/orbekk/protobuf/RpcChannel.java @@ -80,7 +80,9 @@ public class RpcChannel implements com.google.protobuf.RpcChannel { @Override public void run() { RequestMetadata request = ongoingRequests.remove(id); - cancelRequest(request, "timeout"); + if (request != null) { + cancelRequest(request, "timeout"); + } } } diff --git a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java index a1661d2..55cb2cf 100644 --- a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java +++ b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java @@ -167,7 +167,7 @@ public class ProtobufFunctionalTest { final CountDownLatch stop = new CountDownLatch(1); final Rpc rpc = new Rpc(); - rpc.setTimout(1); + rpc.setTimeout(1); service.testC(rpc, request, new RpcCallback<Type2>() { @Override public void run(Type2 result) { stop.countDown(); |