From f0d0d5a136b1623251901571f62017bd138769c4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Oct 2024 21:33:30 -0700 Subject: [PATCH] Add an error return from the figures/image shortcode if the images list contains a nil --- layouts/shortcodes/figures/image.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layouts/shortcodes/figures/image.html b/layouts/shortcodes/figures/image.html index 95f12ef..89c8aa7 100644 --- a/layouts/shortcodes/figures/image.html +++ b/layouts/shortcodes/figures/image.html @@ -21,6 +21,9 @@
{{ range $img := $imgs }} {{- $linkedImg := $img -}} + {{ if not $img }} + {{ errorf "Found nil in images list for %s" $.Page.Permalink }} + {{ end }} {{- if $shouldResize -}} {{ $linkedImg = $img.Fit "1280x1280" }} {{- end -}}