File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -192,9 +192,11 @@ void MimeMessage::setSubject(const QString &subject)
192
192
193
193
void MimeMessage::addPart (const std::shared_ptr<MimePart> &part)
194
194
{
195
- auto content = *d->content ;
196
- if (typeid (content) == typeid (MimeMultiPart)) {
197
- std::static_pointer_cast<MimeMultiPart>(d->content )->addPart (part);
195
+ if (d->content ) {
196
+ auto & content = *d->content ;
197
+ if (typeid (content) == typeid (MimeMultiPart)) {
198
+ std::static_pointer_cast<MimeMultiPart>(d->content )->addPart (part);
199
+ }
198
200
}
199
201
}
200
202
@@ -231,11 +233,13 @@ QString MimeMessage::subject() const
231
233
QList<std::shared_ptr<MimePart>> MimeMessage::parts () const
232
234
{
233
235
QList<std::shared_ptr<MimePart>> ret;
234
- auto content = *d->content ;
235
- if (typeid (content) == typeid (MimeMultiPart)) {
236
- ret = std::static_pointer_cast<MimeMultiPart>(d->content )->parts ();
237
- } else {
238
- ret.append (std::shared_ptr<MimePart>(d->content ));
236
+ if (d->content ) {
237
+ auto & content = *d->content ;
238
+ if (typeid (content) == typeid (MimeMultiPart)) {
239
+ ret = std::static_pointer_cast<MimeMultiPart>(d->content )->parts ();
240
+ } else {
241
+ ret.append (std::shared_ptr<MimePart>(d->content ));
242
+ }
239
243
}
240
244
241
245
return ret;
You can’t perform that action at this time.
0 commit comments