From 341a8d5046205dec2d45e47549fbbf24fc3854b2 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 3 May 2018 11:45:22 -0400 Subject: [PATCH] guard against crashes if set is null or not passed in --- src/user/blocks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user/blocks.js b/src/user/blocks.js index 44bfbac3ce..5834fdd0b4 100644 --- a/src/user/blocks.js +++ b/src/user/blocks.js @@ -76,7 +76,7 @@ module.exports = function (User) { property = 'uid'; } - if (!Array.isArray(set) || !set.length || !(set[0].hasOwnProperty(property) || typeof set[0] === 'number' || typeof set[0] === 'string')) { + if (!set || !Array.isArray(set) || !set.length || !(set[0].hasOwnProperty(property) || typeof set[0] === 'number' || typeof set[0] === 'string')) { return callback(null, set); }