From fa15c8d7048bf335fe170895266a962fdc43b4c6 Mon Sep 17 00:00:00 2001 From: Albert Lucianto Date: Tue, 19 Feb 2019 15:57:50 +0800 Subject: [PATCH] fix: cannot read property 'split' of undefined (#225) * fix: cannot read property 'split' of undefined * fix: lint error in getClassName * fix: lint error in getClassName --- src/getClassName.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/getClassName.js b/src/getClassName.js index d99d858..87e29cd 100644 --- a/src/getClassName.js +++ b/src/getClassName.js @@ -72,6 +72,10 @@ export default (styleNameValue: string, styleModuleImportMap: StyleModuleImportM const handleMissingStyleName = options && options.handleMissingStyleName || DEFAULT_HANDLE_MISSING_STYLENAME_OPTION; + if (!styleNameValue) { + return ''; + } + return styleNameValue .split(' ') .filter((styleName) => {