Skip to content

Commit

Permalink
MP2NL: fix GetVarName() when none available #237
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Dec 9, 2024
1 parent f1fb70c commit 40f3b18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion solvers/mp2nl/mp2nlmodelapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,8 @@ class MP2NLModelAPI
const char* GetVarName(int v) const {
assert(v>=0 && v<(int)var_lbs_.size());
return
(int)var_names_.size() > v ? var_names_[v] : nullptr;
(int)var_names_.size() > v && var_names_[v]
? var_names_[v] : "";
}

/// Feed extended linear part
Expand Down

0 comments on commit 40f3b18

Please sign in to comment.