Skip to content

Commit 51c8cdf

Browse files
committed
Update
1 parent f388b6f commit 51c8cdf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Utilities/universalfallback.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,10 @@ function MOI.get(
486486
listattr::MOI.ListOfVariableAttributesSet,
487487
)
488488
list = MOI.get(uf.model, listattr)
489-
for attr in keys(uf.varattr)
490-
push!(list, attr)
489+
for (attr, dict) in uf.varattr
490+
if !isempty(dict)
491+
push!(list, attr)
492+
end
491493
end
492494
return list
493495
end

test/Utilities/universalfallback.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ function _test_Optimizer_Model_attributes(
103103
@test MOI.get(uf, list) == [attr]
104104
MOI.set(uf, attr, nothing)
105105
@test isempty(MOI.get(uf, list))
106+
MOI.set(uf, attr, 0)
106107
return
107108
end
108109

0 commit comments

Comments
 (0)