Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against nothing appearing from load_package() #52788

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Guard against nothing appearing from load_package()
  • Loading branch information
staticfloat committed Jan 7, 2024
commit da0caa925e5edd4347465b6f718dc1d2693d1718
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