X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/060d38d627bd1e51dd2b3c6e7de9af6aa7d7b6f3..ca6e3f04150dae9af6b86828a5af2a4400892487:/services/api/lib/safe_json.rb diff --git a/services/api/lib/safe_json.rb b/services/api/lib/safe_json.rb index f4da283d74..f78a3d34dc 100644 --- a/services/api/lib/safe_json.rb +++ b/services/api/lib/safe_json.rb @@ -7,6 +7,12 @@ class SafeJSON return Oj.dump(o, mode: :compat) end def self.load(s) + if s.nil? or s == '' + # Oj 2.18.5 used to return nil. Not anymore on 3.6.4. + # Upgraded for performance issues (see #13803 and + # https://github.com/ohler55/oj/issues/441) + return nil + end Oj.strict_load(s, symbol_keys: false) end end