Skip to content

Commit

Permalink
Prevent repl crash on invalid command (#3800)
Browse files Browse the repository at this point in the history
Previously, `prepare_cmd` was outside the lock.
  • Loading branch information
oscardssmith authored Feb 16, 2024
1 parent d267986 commit 76070d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ext/REPLExt/REPLExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ function promptf()
return "$(prefix)pkg> "
end

do_cmds(repl::REPL.AbstractREPL, input::String) = do_cmds(repl, prepare_cmd(input))

function do_cmds(repl::REPL.AbstractREPL, commands::Vector{Command})
function do_cmds(repl::REPL.AbstractREPL, commands::Union{String, Vector{Command}})
try
if commands isa String
commands = prepare_cmd(commands)
end
return REPLMode.do_cmds(commands, repl.t.out_stream)
catch err
if err isa PkgError || err isa Resolve.ResolverError
Expand Down

0 comments on commit 76070d2

Please sign in to comment.