Skip to content

Commit

Permalink
Fix None error
Browse files Browse the repository at this point in the history
  • Loading branch information
Will-Tyler committed Sep 6, 2024
1 parent bb9d35f commit 2462e00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vcztools/vcf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ def c_chunk_to_vcf(
info_fields |= _compute_info_fields(gt, alt)
if num_samples == 0:
gt = None
if "call_genotype_phased" in root and not drop_genotypes and num_samples > 0:
if (
"call_genotype_phased" in root
and not drop_genotypes
and (samples_selection is None or num_samples > 0)
):
array = root["call_genotype_phased"]
gt_phased = get_vchunk_array(
array, v_chunk, v_mask_chunk, samples_selection
Expand Down

0 comments on commit 2462e00

Please sign in to comment.