Changeset 32186

Show
Ignore:
Timestamp:
21.05.2018 12:13:17 (3 months ago)
Author:
kjdon
Message:

if the eval didn't work, all the return values might be undefined, so check for this.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/AutoLoadConverters.pm

    r31492 r32186  
    158158        my ($result, $result_str, $new_filename)  
    159159        = eval "\$self->${converter}::convert(\$input_filename, \$output_ext);"; 
    160         if ($result != 0) { 
     160        if (defined $result && $result != 0) { 
    161161        return $new_filename; 
    162162        } 
    163163        my $outhandle=$self->{'outhandle'}; 
    164164        print $outhandle "$converter Conversion error\n"; 
    165         print $outhandle $result_str; 
     165        print $outhandle "$@\n"; 
     166        if (defined $result_str) { 
     167        print $outhandle "$result_str\n"; 
     168        } 
    166169        return ""; 
    167170    }