fix for getEntity and the return of a non-object
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 21 Aug 2002 10:09:15 +0000 (10:09 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 21 Aug 2002 10:09:15 +0000 (10:09 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3383 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime.class.php

index 6676731..8d1def3 100644 (file)
@@ -717,10 +717,13 @@ class message
           $msg = $msg->entities[0];
        }
 
-       if (isset($msg->entities[($ent_a[$cnt-1])-1]))
+        if (isset($msg->entities[($ent_a[$cnt-1])-1]))
        {
-           $msg = $msg->entities[($ent_a[$cnt-1]-1)];
-        }
+           if (is_object($msg->entities[($ent_a[$cnt-1])-1]))
+           {
+               $msg = $msg->entities[($ent_a[$cnt-1]-1)];
+           }
+       }
 
         return $msg;
     }