Verified null checker

This commit is contained in:
Emmanuel Watila
2023-03-17 10:36:16 +01:00
parent a35e5d6524
commit d03e62fd56

View File

@@ -48,7 +48,7 @@ export const getColors = (
const defaultColor = paletteToMui(palette.aGray);
const key = option.toLocaleLowerCase().replace(" ", "_").trim();
const color = list.find((opt: IColors) => opt.name === key);
// Null check in return
return color || defaultColor;
};