PR-766 Fix DNP3 to 'work' even with invalid mappings

This commit is contained in:
Garret Fick 2019-11-11 16:18:14 -05:00
parent 5481a31b04
commit 9df9fd18cd
1 changed files with 6 additions and 5 deletions

View File

@ -196,6 +196,12 @@ void bind_variables(const vector<string>& binding_defs,
continue;
}
const GlueVariable* var = binding.find(name);
if (!var) {
spdlog::error("Unable to bind DNP3 location {} because it is not defined in the application", name);
continue;
}
switch (group_number) {
case GROUP_BINARY_COMMAND:
group_12_max_index = max(group_12_max_index, data_index);
@ -242,12 +248,7 @@ void bind_variables(const vector<string>& binding_defs,
string name = std::get<0>(*it);
int8_t group_number = std::get<1>(*it);
int16_t data_index = std::get<2>(*it);
const GlueVariable* var = binding.find(name);
if (!var) {
spdlog::error("Unable to bind location {} because it is not defined in the application", name);
continue;
}
switch (group_number) {
case GROUP_BINARY_COMMAND: