(svn r24146) -Fix [FS#5153]: Use default value when reading an invalid setting value. (Eddi)

This commit is contained in:
michi_cc 2012-04-17 19:45:04 +00:00
parent 123427749b
commit adb1692f27

View File

@ -364,7 +364,7 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str
SetDParamStr(0, str);
SetDParamStr(1, desc->name);
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_VALUE, WL_CRITICAL);
return 0;
return desc->def;
}
case SDT_MANYOFMANY: {
@ -373,7 +373,7 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str
SetDParamStr(0, str);
SetDParamStr(1, desc->name);
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_VALUE, WL_CRITICAL);
return NULL;
return desc->def;
}
case SDT_BOOLX:
@ -383,7 +383,7 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str
SetDParamStr(0, str);
SetDParamStr(1, desc->name);
ShowErrorMessage(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_VALUE, WL_CRITICAL);
break;
return desc->def;
case SDT_STRING: return orig_str;
case SDT_INTLIST: return str;