Fix alarms() out of scope

The string alarms() is only valid when the define WITH_GSOAP is present.

Fixes: a0a95d887c ("Don't crash when alarms is empty")
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@nexus-software.ie>
pull/4170/head
Bryan O'Donoghue 2024-10-08 11:48:07 +01:00
parent a0a95d887c
commit 1136ef9ebe
1 changed files with 2 additions and 1 deletions

View File

@ -284,8 +284,9 @@ int SOAP_ENV__Fault(struct soap *soap, char *faultcode, char *faultstring, char
#endif
void Monitor::ONVIF::SetNoteSet(Event::StringSet &noteSet) {
if (alarms.empty()) return;
#ifdef WITH_GSOAP
if (alarms.empty()) return;
std::string note = "";
for (auto it = alarms.begin(); it != alarms.end(); ++it) {
note = it->first + "/" + it->second;