[Pkg-javascript-commits] [node-deps-sort] 44/79: Fix calling Object.keys on undefined

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:41:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-deps-sort.

commit ac81e6ae6e3887c628786ec5d4944a0e643e8640
Author: Ben <me at benng.me>
Date:   Tue Jul 29 16:50:32 2014 -0700

    Fix calling Object.keys on undefined
    
    I am not sure why browserify 5 is even running into this issue, but I can't bundle my app anymore without this fix.
---
 index.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/index.js b/index.js
index 5d437ac..9a05f58 100644
--- a/index.js
+++ b/index.js
@@ -95,6 +95,10 @@ function depCmp (hashes) {
         hashes[row.id] = hash;
     }
     function cmp (a, b, limit) {
+        if(!a || !b) {
+            return false;
+        }
+        
         var keys = Object.keys(a);
         if (keys.length !== Object.keys(b).length) return false;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-deps-sort.git



More information about the Pkg-javascript-commits mailing list