Skip to content

Commit

Permalink
childnode array check
Browse files Browse the repository at this point in the history
  • Loading branch information
l3satwik committed Aug 29, 2018
1 parent a670412 commit 1fab258
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/shared/OptionGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ class OptionGroup extends React.PureComponent<
}
);

if (this.optionRef.current && this.optionRef.current.childNodes) {
if (
this.optionRef.current &&
this.optionRef.current.childNodes &&
this.optionRef.current.childNodes.length
) {
this.observer.observe(this.optionRef.current.childNodes[0] as Element);
}
}
Expand Down

0 comments on commit 1fab258

Please sign in to comment.