Permalink
Browse files

avoid astyanax null pointer exceptions

  • Loading branch information...
Dean Hiller
Dean Hiller committed Sep 11, 2013
1 parent 133e524 commit cea429beb85016ad5d12b86d4e0ed784d2dc6870
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/main/java/com/alvazan/orm/layer9z/spi/db/cassandra/CassandraSession.java
@@ -307,7 +307,14 @@ public void clearImpl() throws ConnectionException {
@Override
public RowQuery<byte[], byte[]> createRowQueryReverse() {
- RangeBuilder rangeBldr = new RangeBuilder().setStart(to).setEnd(from).setReversed(true);
+ RangeBuilder rangeBldr = new RangeBuilder();
+ if(to != null)
+ rangeBldr.setStart(to);
+ if(from != null)
+ rangeBldr.setEnd(from);
+
+ rangeBldr.setReversed(true);
+
if(batchSize != null)
rangeBldr = rangeBldr.setLimit(batchSize);
ByteBufferRange range = rangeBldr.build();

0 comments on commit cea429b

Please sign in to comment.