From 36d7b969aabb4821a9627d3414e381affd77a030 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Wed, 24 Aug 2016 02:20:46 +0900 Subject: [PATCH] Suppress error from hash for empty string --- modules/getHashString.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/getHashString.js b/modules/getHashString.js index 3e31b78c..386fad0d 100644 --- a/modules/getHashString.js +++ b/modules/getHashString.js @@ -41,6 +41,8 @@ const Cc = Components.classes; const Ci = Components.interfaces; function getHashString(aString) { + if (!aString) + return ''; const hasher = Cc['@mozilla.org/security/hash;1'] .createInstance(Ci.nsICryptoHash); hasher.init(Ci.nsICryptoHash.MD5);