diff --git a/lib/configuration.js b/lib/configuration.js index 4922345eb..ef445fc2e 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -102,13 +102,16 @@ function applyConfiguration(config) { configuration.options = applyLoggingOptions(configuration.options); - if (config.hooksData || config.options.b || config.options.sandbox) { - throw new Error('DEPRECATED: Dredd does not support ' - + 'sandboxed JS hooks anymore. Use standard JS hooks instead.'); - } - if (config.blueprintPath) { - throw new Error('DEPRECATED: Dredd does not support ' - + "the 'blueprintPath' option anymore. Use 'path' instead."); + if (config) { + if (config.hooksData + || (config.options && (config.options.b || config.options.sandbox))) { + throw new Error('DEPRECATED: Dredd does not support ' + + 'sandboxed JS hooks anymore. Use standard JS hooks instead.'); + } + if (config.blueprintPath) { + throw new Error('DEPRECATED: Dredd does not support ' + + "the 'blueprintPath' option anymore. Use 'path' instead."); + } } return configuration;