Skip to content

Commit e3b9e49

Browse files
committed
fix: add null check for isObj
1 parent e964df7 commit e3b9e49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Redite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class Redite {
151151

152152
const client = this._redis;
153153
const stackOneKey = stack.length === 1;
154-
const isObj = typeof value === 'object' && value.constructor === Object;
154+
const isObj = value && typeof value === 'object' && value.constructor === Object;
155155

156156
if (Array.isArray(value) && value.length && stackOneKey) {
157157
await client.pdel(stack[0]);

0 commit comments

Comments
 (0)