From 26b30b5f28525ea7c56c1b2f786d9eaa74dfd1b0 Mon Sep 17 00:00:00 2001 From: Josh Birdwell Date: Wed, 6 Dec 2017 17:54:41 -0600 Subject: [PATCH] fixes #1217: edge case with default watchOptions value There is a problem when watchOptions is set to undefined in the options object. this.watchOptions is then set to undefined. We want an empty object so we can check poll property later. --- lib/Server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Server.js b/lib/Server.js index 7a73c1ca20..f0f21630ab 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -50,7 +50,7 @@ function Server(compiler, options) { this.allowedHosts = options.allowedHosts; this.sockets = []; this.contentBaseWatchers = []; - this.watchOptions = options.watchOptions; + this.watchOptions = options.watchOptions || {}; // Listening for events const invalidPlugin = () => {