From: Michael Friedrich Date: Wed, 11 Dec 2013 16:18:01 +0000 (+0100) Subject: Compat: Don't dump empty CV keys. X-Git-Tag: v0.0.6~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e4da258fc3b75ac342f0be8dca5f0f66988ea3c;p=icinga2 Compat: Don't dump empty CV keys. Fixes #5306 --- diff --git a/components/compat/statusdatawriter.cpp b/components/compat/statusdatawriter.cpp index c60943b1b..9a79a2b3c 100644 --- a/components/compat/statusdatawriter.cpp +++ b/components/compat/statusdatawriter.cpp @@ -520,13 +520,15 @@ void StatusDataWriter::DumpCustomAttributes(std::ostream& fp, const DynamicObjec ObjectLock olock(custom); BOOST_FOREACH(const Dictionary::Pair& kv, custom) { - fp << "\t"; + if (!kv.first.IsEmpty()) { + fp << "\t"; - if (kv.first != "notes" && kv.first != "action_url" && kv.first != "notes_url" && - kv.first != "icon_image" && kv.first != "icon_image_alt" && kv.first != "statusmap_image" && kv.first != "2d_coords") - fp << "_"; + if (kv.first != "notes" && kv.first != "action_url" && kv.first != "notes_url" && + kv.first != "icon_image" && kv.first != "icon_image_alt" && kv.first != "statusmap_image" && kv.first != "2d_coords") + fp << "_"; - fp << kv.first << "\t" << kv.second << "\n"; + fp << kv.first << "\t" << kv.second << "\n"; + } } }