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 bd7b7d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mimemessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ void MimeMessage::setSubject(const QString &subject)

void MimeMessage::addPart(const std::shared_ptr<MimePart> &part)
{
auto content = *d->content;
if (typeid(content) == typeid(MimeMultiPart)) {
auto content = d->content;
if (typeid(*content) == typeid(MimeMultiPart)) {
std::static_pointer_cast<MimeMultiPart>(d->content)->addPart(part);
}
}
Expand Down Expand Up @@ -231,8 +231,8 @@ 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)) {
auto content = d->content;
if (typeid(*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 bd7b7d9

Please sign in to comment.