1 parent 79374c0 commit 872bdb8Copy full SHA for 872bdb8
1 file changed
FECore/FEParam.cpp
@@ -242,15 +242,17 @@ FEParam* FEParam::setUnits(const char* szunit) { m_szunit = szunit; return this;
242
FEParam* FEParam::setEnums(const char* sz)
243
{
244
// count the enums
245
- int n = 0;
246
- const char* s = sz;
247
- while ((s != nullptr) && (*s != 0))
+ if (sz && (sz[0] != '$') && (type() == FE_PARAM_INT))
248
249
- s += strlen(s) + 1;
250
- n++;
+ int n = 0;
+ const char* s = sz;
+ while ((s != nullptr) && (*s != 0))
+ {
251
+ s += strlen(s) + 1;
252
+ n++;
253
+ }
254
+ SetValidator(new FEIntValidator(FEParamRange::FE_CLOSED, 0, n - 1));
255
}
-
- SetValidator(new FEIntValidator(FEParamRange::FE_CLOSED, 0, n-1));
256
m_szenum = sz; return this;
257
258
0 commit comments