From 8684e86fdb1875cecc4c6102c65f4d60f101531e Mon Sep 17 00:00:00 2001 From: Igor Kamyshev Date: Fri, 27 Nov 2020 19:16:12 +0700 Subject: [PATCH] Fix Cannot read property 'proxyOf' of undefined exception --- lib/hacks/grid-utils.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/hacks/grid-utils.js b/lib/hacks/grid-utils.js index a552ec3d6..7f6403ad6 100644 --- a/lib/hacks/grid-utils.js +++ b/lib/hacks/grid-utils.js @@ -511,7 +511,15 @@ function insertAreas (css, isDisabled) { // if we can't find the area name, update lastRule and continue if (!area) { - let lastRuleIndex = css.index(rulesToInsert[lastArea].lastRule) + let lastRule = rulesToInsert[lastArea].lastRule + let lastRuleIndex + if (lastRule) { + lastRuleIndex = css.index(lastRule) + } else { + /* istanbul ignore next */ + lastRuleIndex = -1 + } + if (gridAreaRuleIndex > lastRuleIndex) { rulesToInsert[lastArea].lastRule = gridAreaMedia || gridAreaRule }