diff options
-rw-r--r-- | src/nvim/os/fs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index b9a9480cb8..14dacd97c4 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -171,6 +171,10 @@ int os_nodetype(const char *name) | O_NONBLOCK #endif , 0); + if (fd == -1) { + return NODE_OTHER; // open() failed. + } + switch (uv_guess_handle(fd)) { case UV_TTY: // FILE_TYPE_CHAR nodetype = NODE_WRITABLE; |