diff options
author | sunnavy <sunnavy@bestpractical.com> | 2022-09-03 01:12:06 +0300 |
---|---|---|
committer | sunnavy <sunnavy@bestpractical.com> | 2022-09-03 01:12:06 +0300 |
commit | 7e0ee709551c1c8d8be0e9895c007a795384d3d8 (patch) | |
tree | ee2a5bf352140667bbf247beff9c496678e00983 /lib | |
parent | d32618f376b059f3442bb689acbda86cc1e2a8fa (diff) | |
parent | 434a45c7a14873280474e75627b6e60755e912c5 (diff) |
Merge branch '4.4-trunk' into 5.0-trunk
Diffstat (limited to 'lib')
-rw-r--r-- | lib/RT/Attachment.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm index b0b2fc66cc..8b6dc5ea0f 100644 --- a/lib/RT/Attachment.pm +++ b/lib/RT/Attachment.pm @@ -376,8 +376,14 @@ sub OriginalContent { if ($self->IsMessageContentType) { # There shouldn't be more than one "subpart" to a message/* attachment my $child = $self->Children->First; - return $self->Content unless $child and $child->id; - return $child->ContentAsMIME(Children => 1)->as_string; + if ( $child and $child->id ) { + return $child->ContentAsMIME( Children => 1 )->as_string; + } + else { + # No children could happen if $TreatAttachedEmailAsFiles is true. + # Can't indiscriminately return $self->Content as it might be decoded(for textual messages). + # Leave it to the follwing code, which covers this case. + } } return $self->Content unless RT::I18N::IsTextualContentType($self->ContentType); |