From 72f559e1a379cd63e913db66b3b1bd779a867955 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 25 Nov 2016 00:03:29 -0600 Subject: [PATCH] Exit early from `getSymbols` if `object` is nullish. --- lodash.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lodash.js b/lodash.js index 982a591e4..045c88b29 100644 --- a/lodash.js +++ b/lodash.js @@ -6050,6 +6050,9 @@ * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol);