diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-12 16:48:19 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-12 16:48:19 +0200 |
commit | 944ace188c56c5b1313e7597d7bb11079ed5c01d (patch) | |
tree | b56d5b86bb86534bec31915d1cc0d2be4de2e6c0 /lib/Plugins/Bugzilla.cpp | |
parent | 4455e4da4c5efdc2c44614afdee7b9610f8dfbcb (diff) | |
download | abrt-944ace188c56c5b1313e7597d7bb11079ed5c01d.tar.gz abrt-944ace188c56c5b1313e7597d7bb11079ed5c01d.tar.xz abrt-944ace188c56c5b1313e7597d7bb11079ed5c01d.zip |
Bugzilla: fixed crash with empty comment (zprikryl)
Diffstat (limited to 'lib/Plugins/Bugzilla.cpp')
-rw-r--r-- | lib/Plugins/Bugzilla.cpp | 25 |
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"; |