From 7f150abb0db93d979b426e535766050dd6f48f5b Mon Sep 17 00:00:00 2001 From: "Ryan P. C. McQuen" Date: Fri, 10 Apr 2020 12:38:00 -0700 Subject: [PATCH] Return an empty string if a null or undefined image is passed. --- src/image-helpers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/image-helpers.js b/src/image-helpers.js index a22ff02af..1c454d077 100644 --- a/src/image-helpers.js +++ b/src/image-helpers.js @@ -19,6 +19,9 @@ export default { * @return {String} The image src for the resized image. */ imageForSize(image, {maxWidth, maxHeight}) { + if (!image) { + return ''; + } const splitUrl = image.src.split('?'); const notQuery = splitUrl[0]; const query = splitUrl[1] ? `?${splitUrl[1]}` : '';