RT 3.8.17
[freeside.git] / rt / lib / RT / EmailParser.pm
index 3c77f46..46317ce 100644 (file)
@@ -2,7 +2,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -584,10 +584,10 @@ sub RescueOutlook {
         my $text_part;
         if ( $mime->head->get('Content-Type') =~ m{multipart/mixed} ) {
             my $first = $mime->parts(0);
-            if ( $first->head->get('Content-Type') =~ m{multipart/alternative} )
+            if ( $first && $first->head->get('Content-Type') =~ m{multipart/alternative} )
             {
                 my $inner_first = $first->parts(0);
-                if ( $inner_first->head->get('Content-Type') =~ m{text/plain} )
+                if ( $inner_first && $inner_first->head->get('Content-Type') =~ m{text/plain} )
                 {
                     $text_part = $inner_first;
                 }
@@ -595,7 +595,7 @@ sub RescueOutlook {
         }
         elsif ( $mime->head->get('Content-Type') =~ m{multipart/alternative} ) {
             my $first = $mime->parts(0);
-            if ( $first->head->get('Content-Type') =~ m{text/plain} ) {
+            if ( $first && $first->head->get('Content-Type') =~ m{text/plain} ) {
                 $text_part = $first;
             }
         }
@@ -629,9 +629,6 @@ sub DESTROY {
 
 
 
-eval "require RT::EmailParser_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/EmailParser_Vendor.pm});
-eval "require RT::EmailParser_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/EmailParser_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;