diff --git a/stdlib/REPL/src/Pkg_beforeload.jl b/stdlib/REPL/src/Pkg_beforeload.jl index 3ce2f1c45bfec..6081b121efdc7 100644 --- a/stdlib/REPL/src/Pkg_beforeload.jl +++ b/stdlib/REPL/src/Pkg_beforeload.jl @@ -70,10 +70,14 @@ end function projname(project_file::String) if isfile(project_file) - p = Base.TOML.Parser() - Base.TOML.reinit!(p, read(project_file, String); filepath=project_file) - proj = Base.TOML.parse(p) - name = get(proj, "name", nothing) + try + p = Base.TOML.Parser() + Base.TOML.reinit!(p, read(project_file, String); filepath=project_file) + proj = Base.TOML.parse(p) + name = get(proj, "name", nothing) + catch + name = nothing + end else name = nothing end