mirror of https://github.com/djcb/mu.git
message: double-check part-type in Multipart
Avoid exception for some messages (unsigned messages with signed attachment).
This commit is contained in:
parent
9004363aa5
commit
c5f3894374
|
@ -1291,12 +1291,15 @@ public:
|
||||||
void for_each(const ForEachFunc& func) const noexcept;
|
void for_each(const ForEachFunc& func) const noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Note: the part may not be available if the message was marked as
|
||||||
|
// _signed_ or _encrypted_ because it contained a forwarded signed or
|
||||||
|
// encrypted message.
|
||||||
Option<MimePart> part(int index) const {
|
Option<MimePart> part(int index) const {
|
||||||
if (MimeObject mobj{g_mime_multipart_get_part(self(),index)}; !mobj)
|
if (auto&& p{g_mime_multipart_get_part(self() ,index)};
|
||||||
|
!GMIME_IS_PART(p))
|
||||||
return Nothing;
|
return Nothing;
|
||||||
else
|
else
|
||||||
return mobj;
|
return Some(MimeObject{p});
|
||||||
}
|
}
|
||||||
|
|
||||||
GMimeMultipart* self() const {
|
GMimeMultipart* self() const {
|
||||||
|
|
Loading…
Reference in New Issue