Skip to content

Commit

Permalink
Guard against nothing appearing from load_package() (JuliaLang#52788
Browse files Browse the repository at this point in the history
)
  • Loading branch information
staticfloat committed Jan 7, 2024
1 parent c63c3b0 commit e2b31cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,11 @@ function warn_if_already_loaded_different(uuidkey::PkgId)
pkgorig = get(pkgorigins, uuidkey, nothing)
if pkgorig !== nothing && pkgorig.path !== nothing
new_path = locate_package(uuidkey)

# new_path can be `nothing` if `uuidkey` is not loadable in this environment
if new_path === nothing
return
end
if !samefile(fixup_stdlib_path(pkgorig.path), new_path)
if isnothing(pkgorig.version)
v = get_pkgversion_from_path(dirname(dirname(pkgorig.path)))
Expand Down

0 comments on commit e2b31cd

Please sign in to comment.