Suppress error from hash for empty string

This commit is contained in:
Piro / YUKI Hiroshi 2016-08-24 02:20:46 +09:00
parent d824402f3d
commit 36d7b969aa

View File

@ -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);