Skip to content

Commit

Permalink
HLS: Fix map data exists check when merging segments
Browse files Browse the repository at this point in the history
`map_data` may resolve Truthy, while `map_data[1]` itself could be None, resulting in `None` being written to the stream.
  • Loading branch information
rlaphoenix committed Feb 20, 2024
1 parent 2635d06 commit 7f898cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion devine/core/manifests/hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def merge(to: Path, via: list[Path], delete: bool = False, include_map_data: boo
include_map_data: Whether to include the init map data.
"""
with open(to, "wb") as x:
if include_map_data and map_data:
if include_map_data and map_data and map_data[1]:
x.write(map_data[1])
for file in via:
x.write(file.read_bytes())
Expand Down

0 comments on commit 7f898cf

Please sign in to comment.