From be024c1bbe8ca08b559ec984f14510d6193a2eb6 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Wed, 10 Oct 2018 23:58:16 -0400 Subject: [PATCH] quickfix array check --- client/src/modules/reactcomponents.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/modules/reactcomponents.js b/client/src/modules/reactcomponents.js index 8b71e6e9..4dbdf46c 100644 --- a/client/src/modules/reactcomponents.js +++ b/client/src/modules/reactcomponents.js @@ -131,7 +131,8 @@ class Helpers { static findByProp(obj, what, value) { if (obj.hasOwnProperty(what) && obj[what] === value) return obj; if (obj.props && !obj.children) return this.findByProp(obj.props, what, value); - if (!obj.children || !obj.children.length) return null; + if (!obj.children) return null; + if (!(obj.children instanceof Array)) return this.findByProp(obj.children, what, value); for (const child of obj.children) { if (!child) continue; const findInChild = this.findByProp(child, what, value);