Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fix NPE in DoubleSerializer for nonexistent columns #421

merged 1 commit into from

2 participants


DoubleSerializer uses LongSerializer internally. However whenever LongSerializer returns null (such as when the column does not exist) this would cause a NullPointerException.

Here I add some guards similar to what already exist in LongSerializer.


Good catch - thanks.

@zznate zznate merged commit 59de8d1 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2012
  1. @amrik
This page is out of date. Refresh to see the latest.
6 core/src/main/java/me/prettyprint/cassandra/serializers/
@@ -20,12 +20,16 @@ public static DoubleSerializer get() {
public ByteBuffer toByteBuffer(Double obj) {
+ if (obj == null) {
+ return null;
+ }
return LongSerializer.get().toByteBuffer(Double.doubleToRawLongBits(obj));
public Double fromByteBuffer(ByteBuffer bytes) {
- return Double.longBitsToDouble (LongSerializer.get().fromByteBuffer(bytes));
+ Long l = LongSerializer.get().fromByteBuffer(bytes);
+ return l == null ? null : Double.longBitsToDouble (l);
Something went wrong with that request. Please try again.