From 76d73e0e02607ae3d54c153c43974c4a91271b75 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 29 Nov 2022 12:25:58 -0600 Subject: [PATCH] prevent crash if desired attr is not available. --- client/components/combobox.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/combobox.jsx b/client/components/combobox.jsx index 184e95d20..66e7053da 100644 --- a/client/components/combobox.jsx +++ b/client/components/combobox.jsx @@ -87,9 +87,9 @@ const Combobox = createClass({ const filteredArrays = filterOn.map((attr)=>{ const children = dropdownChildren.filter((item)=>{ if(suggestMethod === 'includes'){ - return item.props[attr].toLowerCase().includes(this.state.value.toLowerCase()); + return item.props[attr]?.toLowerCase().includes(this.state.value.toLowerCase()); } else if(suggestMethod === 'startsWith'){ - return item.props[attr].toLowerCase().startsWith(this.state.value.toLowerCase()); + return item.props[attr]?.toLowerCase().startsWith(this.state.value.toLowerCase()); } }); return children;