Skip to content

Commit 10ded94

Browse files
Martin Dimitrovremy
Martin Dimitrov
authored andcommitted
fix: fixed an issue where we tried to resolve null as path
1 parent 14fcf94 commit 10ded94

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

lib/monitor/watch.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,20 @@ function filterAndRestart(files) {
142142

143143
// if there's no matches, then test to see if the changed file is the
144144
// running script, if so, let's allow a restart
145-
const script = path.resolve(config.options.execOptions.script);
146-
if (matched.result.length === 0 && script) {
147-
const length = script.length;
148-
files.find(file => {
149-
if (file.substr(-length, length) === script) {
150-
matched = {
151-
result: [ file ],
152-
total: 1,
145+
if (config.options.execOptions.script) {
146+
const script = path.resolve(config.options.execOptions.script);
147+
if (matched.result.length === 0 && script) {
148+
const length = script.length;
149+
files.find(file => {
150+
if (file.substr(-length, length) === script) {
151+
matched = {
152+
result: [ file ],
153+
total: 1,
154+
}
155+
return true;
153156
}
154-
return true;
155-
}
156-
})
157+
})
158+
}
157159
}
158160

159161
utils.log.detail('changes after filters (before/after): ' +

0 commit comments

Comments
 (0)