diff --git a/lib/common.js b/lib/common.js index 8732322..0aaf85a 100644 --- a/lib/common.js +++ b/lib/common.js @@ -321,6 +321,10 @@ function normShortId(s) { * to use for caching */ function slug(o) { + assert.object(o, 'o'); + assert.string(o.account, 'o.account'); + assert.string(o.url, 'o.url'); + var acct = o.account.replace(/[@]/g, '_'); var url = o.url.replace(/^https?:\/\//, ''); var s = format('%s@%s', acct, url).replace(/[!#$%\^&\*:'"\?\/\\\.]/g, '_');