Fix error when processing link preview with an array as `inLanguage` (#28252)
This commit is contained in:
parent
336d6260ba
commit
7593465c23
|
@ -37,6 +37,7 @@ class LinkDetailsExtractor
|
||||||
|
|
||||||
def language
|
def language
|
||||||
lang = json['inLanguage']
|
lang = json['inLanguage']
|
||||||
|
lang = lang.first if lang.is_a?(Array)
|
||||||
lang.is_a?(Hash) ? (lang['alternateName'] || lang['name']) : lang
|
lang.is_a?(Hash) ? (lang['alternateName'] || lang['name']) : lang
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue