From 10eba54e1bfc977289d29cd619b5d8b3af853883 Mon Sep 17 00:00:00 2001 From: Paul Von Schrottky Date: Mon, 15 Feb 2021 21:38:01 -0300 Subject: [PATCH] Ignore empty width attribute in columns The editor was crashing when attempting to render a column block which contained an empty width attribute (i.e ``. The exception occurred when accessing a property of an undefined object, so adding a default object (`|| {}`) fixes this by allowing the property to be accessed. --- .../src/mobile/utils/use-unit-converter-to-mobile.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/mobile/utils/use-unit-converter-to-mobile.native.js b/packages/components/src/mobile/utils/use-unit-converter-to-mobile.native.js index cf8a77b8d0e56..fda7ff8efc912 100644 --- a/packages/components/src/mobile/utils/use-unit-converter-to-mobile.native.js +++ b/packages/components/src/mobile/utils/use-unit-converter-to-mobile.native.js @@ -37,7 +37,7 @@ const getValueAndUnit = ( value, unit ) => { const convertUnitToMobile = ( containerSize, globalStyles, value, unit ) => { const { width, height } = containerSize; - const { valueToConvert, valueUnit } = getValueAndUnit( value, unit ); + const { valueToConvert, valueUnit } = getValueAndUnit( value, unit ) || {}; const { fontSize = 16 } = globalStyles || {}; switch ( valueUnit ) {