projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
13959: Merge branch 'master' into 13959-timeouts-and-logging
[arvados.git]
/
services
/
api
/
lib
/
safe_json.rb
diff --git
a/services/api/lib/safe_json.rb
b/services/api/lib/safe_json.rb
index f4da283d746fcbecba6a03ce54fa041f0e3f58de..f78a3d34dc5d00b2d47ac8b4f9634d319c5462bc 100644
(file)
--- 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)
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
Oj.strict_load(s, symbol_keys: false)
end
end