diff --git a/components/pill-container/private/selected-listbox.jsx b/components/pill-container/private/selected-listbox.jsx index a2263957a6..3f3f5ad667 100644 --- a/components/pill-container/private/selected-listbox.jsx +++ b/components/pill-container/private/selected-listbox.jsx @@ -140,7 +140,7 @@ const getAvatar = (option) => { }; const getIcon = (option) => { - const iconObject = option.icon; + const iconObject = option?.icon || null; let icon = null; if (iconObject) { diff --git a/components/pill/index.jsx b/components/pill/index.jsx index ccc4ca9958..f73c03cc76 100644 --- a/components/pill/index.jsx +++ b/components/pill/index.jsx @@ -198,7 +198,7 @@ class Pill extends React.Component { }; renderIcon = () => { - const icon = this.props.icon || this.props.avatar; + const icon = this.props?.icon || this.props?.avatar; if (icon) { return {icon}; }