FIX: Check that the node has a src attr when getting size (#19696)

This commit is contained in:
Roman Rizzi
2023-01-03 15:27:05 -03:00
committed by GitHub
parent b4adb806e5
commit c2e18c41a3
2 changed files with 9 additions and 2 deletions

View File

@ -149,7 +149,7 @@ module CookedProcessorMixin
return unless image_sizes.present?
image_sizes.each do |image_size|
url, size = image_size[0], image_size[1]
if url && url.include?(src) &&
if url && src && url.include?(src) &&
size && size["width"].to_i > 0 && size["height"].to_i > 0
return [size["width"], size["height"]]
end