Fix safe navigation

This commit is contained in:
Ajay Ramachandran 2021-12-20 22:29:48 -05:00 committed by GitHub
parent 89a83f78cc
commit 7caaf833dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@ function getSortField<T extends string>(...value: T[]): SortableFields {
}, {} as Record<string, SortableFields>);
for (const name of value) {
if (name?.trim().toLowerCase() in fieldByName) {
if (name?.trim()?.toLowerCase() in fieldByName) {
return fieldByName[name.trim().toLowerCase()];
}
}