diff --git a/src/main/java/net/spy/memcached/ArcusClient.java b/src/main/java/net/spy/memcached/ArcusClient.java index 0a66d33cc..941743c30 100644 --- a/src/main/java/net/spy/memcached/ArcusClient.java +++ b/src/main/java/net/spy/memcached/ArcusClient.java @@ -1111,7 +1111,7 @@ public Map get(long duration, throw new ExecutionException(op.getException()); } - if (op.isCancelled()) { + if (op != null && op.isCancelled()) { throw new ExecutionException(new RuntimeException(op.getCancelCause())); } } @@ -2453,7 +2453,7 @@ public List> get(long duration, TimeUnit units) throw new ExecutionException(op.getException()); } - if (op.isCancelled()) { + if (op != null && op.isCancelled()) { throw new ExecutionException(new RuntimeException( op.getCancelCause())); } @@ -2711,7 +2711,7 @@ public List> get(long duration, TimeUnit units) throw new ExecutionException(op.getException()); } - if (op.isCancelled()) { + if (op != null && op.isCancelled()) { throw new ExecutionException(new RuntimeException(op.getCancelCause())); } } @@ -4114,7 +4114,7 @@ public Map get(long duration, throw new ExecutionException(op.getException()); } - if (op.isCancelled()) { + if (op != null && op.isCancelled()) { throw new ExecutionException(new RuntimeException(op.getCancelCause())); } } @@ -4391,7 +4391,7 @@ public Map get(long duration, throw new ExecutionException(op.getException()); } - if (op.isCancelled()) { + if (op != null && op.isCancelled()) { throw new ExecutionException(new RuntimeException(op.getCancelCause())); } } diff --git a/src/main/java/net/spy/memcached/internal/CollectionGetBulkFuture.java b/src/main/java/net/spy/memcached/internal/CollectionGetBulkFuture.java index d7fe2cb61..93ef75e3e 100644 --- a/src/main/java/net/spy/memcached/internal/CollectionGetBulkFuture.java +++ b/src/main/java/net/spy/memcached/internal/CollectionGetBulkFuture.java @@ -69,7 +69,7 @@ public T get(long duration, TimeUnit units) throws InterruptedException, Timeout if (op != null && op.hasErrored()) { throw new ExecutionException(op.getException()); } - if (op.isCancelled()) { + if (op != null && op.isCancelled()) { throw new ExecutionException(new RuntimeException(op.getCancelCause())); } }