'message/rfc822' parts may not have subparts.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 10 Dec 2008 23:08:16 +0000 (16:08 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 10 Dec 2008 23:08:16 +0000 (16:08 -0700)
The entire text of the message may live solely in the present part.

framework/Mime/lib/Horde/Mime/Part.php

index bc3a54e..a9f5f99 100644 (file)
@@ -1230,8 +1230,10 @@ class Horde_Mime_Part
             $id .= '.';
 
             if ($this->getType() == 'message/rfc822') {
-                reset($this->_parts);
-                $this->_parts[key($this->_parts)]->buildMimeIds($id, true);
+                if (count($this->_parts)) {
+                    reset($this->_parts);
+                    $this->_parts[key($this->_parts)]->buildMimeIds($id, true);
+                }
             } elseif (!empty($this->_parts)) {
                 $i = 1;
                 foreach (array_keys($this->_parts) as $val) {