Changeset 7427


Ignore:
Timestamp:
12/16/10 11:00:53 (9 years ago)
Author:
melissa
Message:

Catch exception when parsing .mdb files, so that .lsm files can be read even if the corresponding .mdb has been corrupted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r7318 r7427  
    357357    else lsmFilenames = new String[] {id}; 
    358358 
    359     if (lsmFilenames.length == 0) { 
     359    if (lsmFilenames == null || lsmFilenames.length == 0) { 
    360360      throw new FormatException("LSM files were not found."); 
    361361    } 
     
    495495        // make sure that the .mdb references this .lsm 
    496496        String[] lsms = parseMDB(file.getAbsolutePath()); 
     497        if (lsms == null) return null; 
    497498        for (String lsm : lsms) { 
    498499          if (id.endsWith(lsm) || lsm.endsWith(id)) { 
     
    15941595    } 
    15951596 
    1596     mdbService.initialize(mdbFile); 
     1597    try { 
     1598      mdbService.initialize(mdbFile); 
     1599    } 
     1600    catch (Exception e) { 
     1601      return null; 
     1602    } 
    15971603    Vector<Vector<String[]>> tables = mdbService.parseDatabase(); 
    15981604    Vector<String> referencedLSMs = new Vector<String>(); 
Note: See TracChangeset for help on using the changeset viewer.