The Generator::State::op_href returns a raw java null when the given attribute is missing #155

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

jvshahid commented Jan 15, 2013

Although the returned value compares to nil perfectly because JRuby do the conversion behind the scenes, calling anything on the returned object will cause a null pointer exception to be thrown.

This pull request includes a test to demonstrate the error and a fix for it.

Contributor

jvshahid commented Jan 20, 2013

ping. is there anything stopping this pr from being merged ?

@sluukkonen sluukkonen referenced this pull request in jruby/jruby Jan 29, 2013

Closed

Update json to 1.7.6 #512

👍 Please merge this PR.

1.7.6 doesn't fix the nullPointerException as you can test that with the following code

gem 'json', '=1.7.6'
require 'active_support/all'

puts JSON::VERSION

h = { a: 1 }
puts JSON.dump(h)

hi = HashWithIndifferentAccess.new(h)
puts JSON.dump(hi)

@BanzaiMan BanzaiMan referenced this pull request in jruby/jruby Feb 2, 2013

Closed

JSON.dump a HashWithIndifferentAccess #507

Owner

flori commented Feb 5, 2013

This problem is now fixed in the current master, so you can check it out.

@flori flori closed this Feb 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment