From 6afbe192d80e12b925c674ef0fed81808c033f43 Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Fri, 20 Sep 2019 16:56:02 -0700 Subject: [PATCH] Log a warning if `dataURI` property is missing from image argument specification in extension info. Default to empty string if dataURI or alt are not provided. --- src/engine/runtime.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index a90d2f80c..f6b8bc40b 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1244,10 +1244,13 @@ class Runtime extends EventEmitter { // check if this is not one of those cases. E.g. an inline image on a block. if (argTypeInfo.type && !argTypeInfo.shadowType && !argTypeInfo.fieldType) { if (argTypeInfo.type === 'IMAGE') { + if (!argInfo.dataURI) { + log.warn('Missing data URI in extension block with argument type IMAGE'); + } argJSON = { type: 'field_image', - alt: argInfo.alt, - src: argInfo.dataURI, + alt: argInfo.alt || '', + src: argInfo.dataURI || '', // TODO these probably shouldn't be hardcoded...? width: 24, height: 24,