[aligner] one more safety belt to avoid crash on empty sets
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
Fri, 16 Feb 2018 17:16:31 +0100
changeset 520 2381069255a2
parent 518 18c42a345591
child 521 6fed581fa8ec
[aligner] one more safety belt to avoid crash on empty sets
rl/aligner.py
--- a/rl/aligner.py	Tue Nov 28 18:15:10 2017 +0100
+++ b/rl/aligner.py	Fri Feb 16 17:16:31 2018 +0100
@@ -215,6 +215,8 @@
                            encoding=ref_encoding, delimiter=ref_separator)
         targetset = parsefile(targetfile, indexes=target_indexes,
                               encoding=target_encoding, delimiter=target_separator)
+        if not refset or not targetset:
+            return
         global_mat, global_matched = self.align(refset, targetset, get_matrix=False)
         for pair in iter_aligned_pairs(refset, targetset, global_mat, global_matched, unique):
             yield pair