Fix LinkCrawlWorker NoMethodError: undefined method `[]' for nil (#31144)
This commit is contained in:
parent
bfaa53343a
commit
fbf95216c5
2 changed files with 19 additions and 1 deletions
|
@ -101,7 +101,7 @@ class LinkDetailsExtractor
|
|||
end
|
||||
|
||||
def json
|
||||
@json ||= root_array(Oj.load(@data)).find { |obj| SUPPORTED_TYPES.include?(obj['@type']) } || {}
|
||||
@json ||= root_array(Oj.load(@data)).compact.find { |obj| SUPPORTED_TYPES.include?(obj['@type']) } || {}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue