mirror of
https://github.com/duckietm/Nitro-Cool-UI.git
synced 2025-06-21 22:36:58 +00:00
Fix: A null error in chatcolor
This commit is contained in:
parent
08f03feb7d
commit
e4db70d3ba
@ -116,7 +116,11 @@ allowedColours.set('saddlebrown', 'saddlebrown');
|
|||||||
allowedColours.set('sienna', 'sienna');
|
allowedColours.set('sienna', 'sienna');
|
||||||
allowedColours.set('brown', 'brown');
|
allowedColours.set('brown', 'brown');
|
||||||
|
|
||||||
export const sanitizeColor = (color: string): string | null => {
|
export const sanitizeColor = (color: string | null | undefined): string | null => {
|
||||||
|
if (!color) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const sanitizedColor = allowedColours.get(color.toLowerCase());
|
const sanitizedColor = allowedColours.get(color.toLowerCase());
|
||||||
return sanitizedColor || null;
|
return sanitizedColor || null;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user