From 0cb5a0ecd487b7e3d2f6844d1aeb966ca54f75b7 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 6 Jan 2024 11:11:28 -0800 Subject: [PATCH] Fix `MethodError` when warning about a toplevel module (#52782) --- base/loading.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base/loading.jl b/base/loading.jl index 9a646120df131..fdb6b0e8fff57 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -2022,7 +2022,10 @@ function warn_if_already_loaded_different(uuidkey::PkgId) end end @warn warnstr - push!(already_warned_path_change_pkgs, uuidkey.uuid) + # Toplevel modules have a `uuid` of `Nothing` + if uuidkey.uuid !== nothing + push!(already_warned_path_change_pkgs, uuidkey.uuid) + end end end end