diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-12-03 05:37:56 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-12-13 08:32:55 +0300 |
commit | cd71fc1545db30ca8589ddf1933167286308ad8f (patch) | |
tree | bf864e6ac504a38a237ef49d49dc80c15fa863cf /src/fs_event_wrap.cc | |
parent | 11ebaff15c39e87aa2850b43847627aff8e6f62e (diff) |
src: make FSEventWrap/StatWatcher::Start more robust
PR-URL: https://github.com/nodejs/node/pull/17432
Fixes: https://github.com/nodejs/node/issues/17430
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/fs_event_wrap.cc')
-rw-r--r-- | src/fs_event_wrap.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 934b9d545c6..85a09060a11 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -111,7 +111,8 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) { FSEventWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - CHECK_EQ(wrap->initialized_, false); + if (wrap->initialized_) + return args.GetReturnValue().Set(0); static const char kErrMsg[] = "filename must be a string or Buffer"; if (args.Length() < 1) |