Closed Watson1978 closed 1 year ago
This patch will raise TypeError exception in JSON.generate if to_json method returns invalid object to avoid SEGV
require 'oj' Oj.mimic_JSON class Foo def to_json nil end end obj = { foo: Foo.new } puts JSON.generate(obj)
Similar: https://github.com/ohler55/oj/pull/836
This patch will raise TypeError exception in JSON.generate if to_json method returns invalid object to avoid SEGV
Test code
Similar: https://github.com/ohler55/oj/pull/836