rgeo/rgeo-geojson

Encoding nil

pdeffendol opened this issue · 2 comments

Current behavior:

1.9.3-p125 :001 > RGeo::GeoJSON.encode(nil)
NoMethodError: undefined method `factory' for nil:NilClass
    from /..../gems/activesupport-3.0.12/lib/active_support/whiny_nil.rb:48:in `method_missing'

Would it be acceptable to simply return nil here? Otherwise it forces developers to include a condition when encoding, for example, arbitrary ActiveRecord object attributes, in which some of them may be nil.

Yeah, that's a good idea. Thanks, I'll make that change.

Version 0.2.3 released with this change.