From 944ace188c56c5b1313e7597d7bb11079ed5c01d Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 12 Aug 2009 16:48:19 +0200 Subject: Bugzilla: fixed crash with empty comment (zprikryl) --- lib/Plugins/Bugzilla.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'lib/Plugins') diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 8a901e3..429adfc 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -182,13 +182,24 @@ bool CReporterBugzilla::CheckUUIDInBugzilla(const std::string& pComponent, const void CReporterBugzilla::CreateNewBugDescription(const map_crash_report_t& pCrashReport, std::string& pDescription) { - pDescription = "\nabrt detected crash.\n" - "\n\nHow to reproduce\n" - "-----\n" + - pCrashReport.find(CD_REPRODUCE)->second[CD_CONTENT] + - "\n\nCommnet\n" - "-----\n" + - pCrashReport.find(CD_COMMENT)->second[CD_CONTENT] + + std::string howToReproduce; + std::string comment; + + if (pCrashReport.find(CD_REPRODUCE) != pCrashReport.end()) + { + howToReproduce = "\n\nHow to reproduce\n" + "-----\n" + + pCrashReport.find(CD_REPRODUCE)->second[CD_CONTENT]; + } + if (pCrashReport.find(CD_COMMENT) != pCrashReport.end()) + { + comment = "\n\nCommnet\n" + "-----\n" + + pCrashReport.find(CD_COMMENT)->second[CD_CONTENT]; + } + pDescription = "\nabrt detected crash.\n" + + howToReproduce + + comment + "\n\nAdditional information\n" "======\n"; -- cgit