Skip to content

Commit

Permalink
Adds null check before function call
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonis Lilis committed Feb 17, 2021
1 parent 064262f commit 086cbfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/components/src/color-palette/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ function ColorPalette( {
}, [ currentSegment ] );

function isSelectedCustom() {
const isWithinColors = activeColor && colors.includes( activeColor );
const isWithinColors =
activeColor && colors && colors.includes( activeColor );
if ( activeColor ) {
if ( isGradientSegment ) {
return isGradientColor && ! isWithinColors;
Expand Down

0 comments on commit 086cbfa

Please sign in to comment.