Changeset 1407


Ignore:
Timestamp:
09/01/06 16:21:57 (14 years ago)
Author:
curtis
Message:

Fix weird NullPointerException in checkEfficiency.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/RandomAccessStream.java

    r1264 r1407  
    353353    } 
    354354 
    355     if (((afp + toRead) < MAX_OVERHEAD) && (afp + toRead < raf.length()) && 
    356       (dis != null)) 
     355    if (dis != null && raf != null && 
     356      afp + toRead < MAX_OVERHEAD && afp + toRead < raf.length()) 
    357357    { 
    358358      // this is a really special case that allows us to read directly from 
    359359      // an array when working with the first MAX_OVERHEAD bytes of the file 
    360360      // ** also note that it doesn't change the stream 
    361  
    362361      return ARRAY; 
    363362    } 
    364     else if ((afp >= fp) && (dis != null)) { 
     363    else if (afp >= fp && dis != null) { 
    365364      while (fp < afp) { 
    366365        int skip = dis.skipBytes(afp - fp); 
     
    384383    } 
    385384    else { 
    386       if ((dis != null) && (afp >= mark) && (fp < (mark + oldBufferSize))) { 
     385      if (dis != null && afp >= mark && fp < mark + oldBufferSize) { 
    387386        int newBufferSize = determineBuffer(); 
    388387 
     
    421420      else { 
    422421        // we don't want this to happen very often 
    423  
    424422        raf.seek(afp); 
    425423        return RAF; 
Note: See TracChangeset for help on using the changeset viewer.