Skip to content

Commit d981284

Browse files
authored
fix(fs): error when escaping out of add and add_directory (#688)
1 parent eaffe19 commit d981284

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/neo-tree/sources/filesystem/lib/fs_actions.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ M.create_directory = function(in_directory, callback, using_root_directory)
277277
end
278278

279279
inputs.input("Enter name for new directory:", base, function(destinations)
280+
if not destinations then
281+
return
282+
end
283+
280284
for _, destination in ipairs(utils.brace_expand(destinations)) do
281285
if not destination or destination == base then
282286
return
@@ -326,6 +330,10 @@ M.create_node = function(in_directory, callback, using_root_directory)
326330
'Enter name for new file or directory (dirs end with a "/"):',
327331
base,
328332
function(destinations)
333+
if not destinations then
334+
return
335+
end
336+
329337
for _, destination in ipairs(utils.brace_expand(destinations)) do
330338
if not destination or destination == base then
331339
return

0 commit comments

Comments
 (0)