From b25cd399532164b79346ca8d5bec84e54d5e8ca4 Mon Sep 17 00:00:00 2001 From: jdalton Date: Fri, 15 May 2015 01:29:17 -0700 Subject: [PATCH] Add `isObject` check to `getNative`. --- lodash.src.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lodash.src.js b/lodash.src.js index 10c6025a3..22117a44b 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -4105,7 +4105,10 @@ * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { - var value = object == null ? undefined : object[key]; + if (!isObject(object)) { + return; + } + var value = object[key]; if (isNative(value)) { return value; }