Skip to content

Commit

Permalink
fix wrong dereferencing
Browse files Browse the repository at this point in the history
  • Loading branch information
640kb authored and Daniel Wendt committed Jul 11, 2024
1 parent d334e47 commit e90e240
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/mimemessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ void MimeMessage::setSubject(const QString &subject)

void MimeMessage::addPart(const std::shared_ptr<MimePart> &part)
{
auto content = *d->content;
if (typeid(content) == typeid(MimeMultiPart)) {
if (typeid(*d->content) == typeid(MimeMultiPart)) {
std::static_pointer_cast<MimeMultiPart>(d->content)->addPart(part);
}
}
Expand Down Expand Up @@ -231,8 +230,7 @@ QString MimeMessage::subject() const
QList<std::shared_ptr<MimePart>> MimeMessage::parts() const
{
QList<std::shared_ptr<MimePart>> ret;
auto content = *d->content;
if (typeid(content) == typeid(MimeMultiPart)) {
if (typeid(*d->content) == typeid(MimeMultiPart)) {
ret = std::static_pointer_cast<MimeMultiPart>(d->content)->parts();
} else {
ret.append(std::shared_ptr<MimePart>(d->content));
Expand Down

0 comments on commit e90e240

Please sign in to comment.