Fix extractText breaking in some cases

This commit is contained in:
Toby Zerner 2017-10-08 08:59:54 +10:30
parent 1f4966bbf1
commit 96be7c449d

View File

@ -7,7 +7,7 @@
export default function extractText(vdom) {
if (vdom instanceof Array) {
return vdom.map(element => extractText(element)).join('');
} else if (typeof vdom === 'object') {
} else if (typeof vdom === 'object' && vdom !== null) {
return extractText(vdom.children);
} else {
return vdom;