fix toaster html strip for undefined values
This commit is contained in:
parent
c744c73845
commit
c2aa517cb7
@ -95,9 +95,9 @@ export class Toaster {
|
||||
}
|
||||
}
|
||||
|
||||
private _sanitizeParams(params: Record<string, string | number>): Record<string, string | null> {
|
||||
private _sanitizeParams(params: Record<string, string | number | undefined>): Record<string, string | null> {
|
||||
return Object.entries(params).reduce((acc, [key, value]) => {
|
||||
acc[key] = stripHtml(value.toString()).result;
|
||||
acc[key] = stripHtml(value?.toString() ?? '').result;
|
||||
return acc;
|
||||
}, {} as Record<string, string | null>);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user