Changeset 15012

Show
Ignore:
Timestamp:
27.02.2008 16:28:31 (11 years ago)
Author:
davidb
Message:

br.readLine() could return null in test for ImageMagick? -- threw exception on Windows version for me -- code modified to test for this being null and returning false if so, before it continues with rest of test for ImageMagick?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/Gatherer.java

    r14974 r15012  
    11601160        //new way of detection of ImageMagick 
    11611161        InputStreamReader isr = new InputStreamReader(image_magick_process.getInputStream()); 
     1162 
    11621163            BufferedReader br = new BufferedReader(isr); 
    11631164            // Capture the standard output stream and seach for two particular occurances: Version and ImageMagick. 
    1164             String line = br.readLine().toLowerCase(); 
    1165         if (line.indexOf("version") != -1 || line.indexOf("imagemagick") != -1) { 
     1165 
     1166            String line = br.readLine(); 
     1167        if (line == null) { 
     1168            return false; 
     1169        } 
     1170            String lc_line = line.toLowerCase(); 
     1171        if (lc_line.indexOf("version") != -1 || lc_line.indexOf("imagemagick") != -1) { 
    11661172            return true; 
    11671173        } else { 
    11681174                return false; 
    11691175        } 
     1176 
    11701177        //return (image_magick_process.exitValue() == 0); 
    11711178        }