diff --git a/solvers/mp2nl/mp2nlmodelapi.h b/solvers/mp2nl/mp2nlmodelapi.h index 0df2bb2eb..a53888f03 100644 --- a/solvers/mp2nl/mp2nlmodelapi.h +++ b/solvers/mp2nl/mp2nlmodelapi.h @@ -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