diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/VariantService.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/VariantService.java index c8f94850..8979882a 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/VariantService.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/VariantService.java @@ -176,13 +176,11 @@ private void loadGenomicCacheFiles() throws FileNotFoundException, IOException, ){ oos.writeObject(bucketIndex); oos.flush(); - oos.close(); } - }else { + }else if (new File(BUCKET_INDEX_BY_SAMPLE_FILE).exists()) { try (ObjectInputStream objectInputStream = new ObjectInputStream(new GZIPInputStream(new FileInputStream(BUCKET_INDEX_BY_SAMPLE_FILE)));){ log.info("loading " + BUCKET_INDEX_BY_SAMPLE_FILE); bucketIndex = (BucketIndexBySample) objectInputStream.readObject(); - objectInputStream.close(); } catch (IOException | ClassNotFoundException e) { log.error("an error occurred", e); }