Skip to content

Commit

Permalink
Improve CONFIG -h SEC PROP error handling
Browse files Browse the repository at this point in the history
`CONFIG -h SEC PROP` now only prints a single error if PROP is
non-existent.
  • Loading branch information
johnnovak committed Jun 11, 2024
1 parent 303ac66 commit 31524de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/misc/programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,19 @@ void CONFIG::Run(void)
if (sec && !sec->IsActive()) {
sec = nullptr;
}

Section* sec2 = control->GetSectionFromProperty(
pvars[1].c_str());

if (!sec || !sec->IsActive()) {
WriteOut(MSG_Get("PROGRAM_CONFIG_PROPERTY_ERROR"),
pvars[0].c_str());
return;

} else if (!sec2 || !sec2->IsActive() || sec != sec2) {
WriteOut(MSG_Get("PROGRAM_CONFIG_PROPERTY_ERROR"),
pvars[1].c_str());
return;
}
break;
}
Expand Down

0 comments on commit 31524de

Please sign in to comment.