Skip to content

Commit

Permalink
fix: prevent crash if undefined color is passed to func fallbackColor
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranav2612000 committed Oct 1, 2022
1 parent fe1ca87 commit e74b543
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ function isValidGradient(colors) {
* @returns {string | string[]}
*/
function fallbackColor(color, fallbackColor) {
let colors = color.split(",");
let colors = color?.split(",");
let gradient = null;

if (colors.length > 1 && isValidGradient(colors)) {
if (colors?.length > 1 && isValidGradient(colors)) {
gradient = colors;
}

Expand Down

0 comments on commit e74b543

Please sign in to comment.