]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 334617: importxml.pl crashes when importing bugs having attachments from version...
authorlpsolit%gmail.com <>
Thu, 20 Apr 2006 04:47:25 +0000 (04:47 +0000)
committerlpsolit%gmail.com <>
Thu, 20 Apr 2006 04:47:25 +0000 (04:47 +0000)
importxml.pl

index 47f886c1c5c15a9bc54e5b3e4ced7cce395ab6d1..59bea430c3efcefcae7581a589d849235ba9f75f 100755 (executable)
@@ -397,7 +397,9 @@ sub process_attachment() {
     $attachment{'isobsolete'} = $attach->{'att'}->{'isobsolete'} || 0;
     $attachment{'isprivate'}  = $attach->{'att'}->{'isprivate'} || 0;
     $attachment{'filename'}   = $attach->field('filename') || "file";
-    if ( defined( $attach->first_child('data')->{'att'}->{'encoding'} )
+    # Attachment data is not exported in versions 2.20 and older.
+    if (defined $attach->first_child('data')
+        && defined $attach->first_child('data')->{'att'}->{'encoding'}
         && $attach->first_child('data')->{'att'}->{'encoding'} =~ /base64/ )
     {
         # decode the base64