Skip to content

Commit 491b69c

Browse files
committed
Check if the index file exists before attempting search
1 parent 83962e1 commit 491b69c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

newmap/search.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,11 @@ def main(args):
717717
index_filename = Path(fasta_filename).stem + \
718718
"." + INDEX_EXTENSION
719719

720+
# Check that the index file exists
721+
index_filename = Path(index_filename)
722+
if not index_filename.is_file():
723+
raise FileNotFoundError(f"Index file not found: {index_filename}")
724+
720725
# Parse the kmer lengths
721726
# NB: Either comma seperated or a range seperated by a colon
722727
kmer_lengths = []

0 commit comments

Comments
 (0)