Skip to content

Commit

Permalink
fix: add null check for isObj
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovyerus committed Mar 6, 2019
1 parent e964df7 commit e3b9e49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Redite.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Redite {

const client = this._redis;
const stackOneKey = stack.length === 1;
const isObj = typeof value === 'object' && value.constructor === Object;
const isObj = value && typeof value === 'object' && value.constructor === Object;

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

0 comments on commit e3b9e49

Please sign in to comment.