summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-08-12 16:48:19 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-08-12 16:48:19 +0200
commit944ace188c56c5b1313e7597d7bb11079ed5c01d (patch)
treeb56d5b86bb86534bec31915d1cc0d2be4de2e6c0
parent4455e4da4c5efdc2c44614afdee7b9610f8dfbcb (diff)
downloadabrt-944ace188c56c5b1313e7597d7bb11079ed5c01d.tar.gz
abrt-944ace188c56c5b1313e7597d7bb11079ed5c01d.tar.xz
abrt-944ace188c56c5b1313e7597d7bb11079ed5c01d.zip
Bugzilla: fixed crash with empty comment (zprikryl)
-rw-r--r--lib/Plugins/Bugzilla.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index 8a901e39..429adfce 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";