fixed condition where to_hash called on nil. #26

Merged
merged 2 commits into from Aug 30, 2012

2 participants

@usergenic

We use the fetch_hash method to retrieve single items but ran into a case where nothing was returned when fetch_row was called and subsequently the to_hash call on the nil row raised a NoMethodError. It feels like the more appropriate result would be to return nil from fetch_hash.

I don't know if that violates any design principle for fetch_hash interface that you envision, but this is the workaround we use.

@usergenic usergenic commented on the diff Mar 14, 2012
lib/cassandra-cql/result.rb
+end
@usergenic
usergenic added a line comment Mar 14, 2012

This newline at end-of-file change was unintentional -- my editor was overzealous apparently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@kreynolds kreynolds merged commit 0f2e696 into kreynolds:master Aug 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment