Explorar o código

fix(converter.js): add error if the passed argument is not an object

Estevao Soares dos Santos %!s(int64=10) %!d(string=hai) anos
pai
achega
d86ed450a8
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/converter.js

+ 3 - 0
src/converter.js

@@ -76,6 +76,9 @@ showdown.Converter = function (converterOptions) {
           options[opt] = converterOptions[opt];
         }
       }
+    } else {
+      throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
+      ' was passed instead.')
     }
 
     if (options.extensions) {