Open river-etoa opened 2 years ago
this took me 4h to find ffs
Wouldn't a better fix be writing also default values to the DB?
Yes, but:
the current eventhandler code assumes cConfig is always a vector of size 3, which is broken in Config::get without this patch. better idea would be to refactor the config code.
did some code refactor with ee21169. now uses a single map, and the value is a fixed-size array instead of a var-length vector to avoid undefined elements.
std::string Config::get
returns-nan
and this fucks upConfig::nget
, which ultimately results init works for value (p0) and param2 for some reason but not for param1.
issue is in default constructor / return values for
std::map<std::string, int> sConfig
andstd::vector<std::vector<std::string> > cConfig
due to incorrect assumptions on how c++ container initialization, object assignment and default return values work.All this gets triggered by the underlying incorrect assumption in the eventhandler that every possible config value has an entry in the DB, whereas the frontend only seems to put non-default config values in the DB and uses the default values from XML in some places(?).