diff --git a/slug.js b/slug.js index 010c89f..55ac07b 100644 --- a/slug.js +++ b/slug.js @@ -10,6 +10,8 @@ function symbols(code) { } function slug(string, opts) { + if (string === null || string === undefined) + throw new Error('Slug input must be castable to string') string = string.toString(); if ('string' === typeof opts) opts = {replacement:opts};