mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 09:01:09 +03:00
bugfix: Add nil check in escapeAllStrings to prevent TypeError when upsert vectors (#3789)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { isNil } from 'lodash'
|
||||
|
||||
/*
|
||||
* Escapes all '-' characters.
|
||||
* Redis Search considers '-' as a negative operator, hence we need
|
||||
@@ -8,6 +10,10 @@ export const escapeSpecialChars = (str: string) => {
|
||||
}
|
||||
|
||||
export const escapeAllStrings = (obj: object) => {
|
||||
if (isNil(obj)) {
|
||||
// return if obj is null or undefined to avoid "TypeError: Cannot convert undefined or null to object"
|
||||
return
|
||||
}
|
||||
Object.keys(obj).forEach((key: string) => {
|
||||
// @ts-ignore
|
||||
let item = obj[key]
|
||||
|
||||
Reference in New Issue
Block a user