From 1136ef9ebe982a9966db343b15b27508d7508285 Mon Sep 17 00:00:00 2001 From: Bryan O'Donoghue Date: Tue, 8 Oct 2024 11:48:07 +0100 Subject: [PATCH] Fix alarms() out of scope The string alarms() is only valid when the define WITH_GSOAP is present. Fixes: a0a95d887c03 ("Don't crash when alarms is empty") Signed-off-by: Bryan O'Donoghue --- src/zm_monitor_onvif.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_monitor_onvif.cpp b/src/zm_monitor_onvif.cpp index a45d644fd..1cac78b3d 100644 --- a/src/zm_monitor_onvif.cpp +++ b/src/zm_monitor_onvif.cpp @@ -284,8 +284,9 @@ int SOAP_ENV__Fault(struct soap *soap, char *faultcode, char *faultstring, char #endif void Monitor::ONVIF::SetNoteSet(Event::StringSet ¬eSet) { - 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;