Skip to content

Commit f76c973

Browse files
committed
fixed problem in initialization
1 parent bc47e64 commit f76c973

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,5 @@
9191
"Yinyu",
9292
"Zentrum",
9393
"Zuse"
94-
],
95-
"julia.environmentPath": "e:\\Repos\\MSR\\OpticalCompute\\AOCoptimizer.jl\\notebooks"
94+
]
9695
}

src/init.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ module MOI
99
function __init()
1010
__modules = Base.loaded_modules_array()
1111
__index_of_jump_ext = findfirst(x -> nameof(x) == :JuMPExt, __modules)
12-
__jump_ext = __modules[__index_of_jump_ext]
13-
Optimizer[] = __jump_ext.Optimizer
12+
if __index_of_jump_ext === nothing
13+
# JuMPExt is not loaded, leaving value to `nothing`
14+
Optimizer[] = nothing
15+
else
16+
__jump_ext = __modules[__index_of_jump_ext]
17+
Optimizer[] = __jump_ext.Optimizer
18+
end
1419
end
1520
end
1621

0 commit comments

Comments
 (0)