HLS: Fix map data exists check when merging segments

`map_data` may resolve Truthy, while `map_data[1]` itself could be None, resulting in `None` being written to the stream.
This commit is contained in:
rlaphoenix 2024-02-20 02:14:58 +00:00
parent 2635d06d58
commit 7f898cf2df
1 changed files with 1 additions and 1 deletions

View File

@ -306,7 +306,7 @@ class HLS:
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())