From 7f898cf2dfc6375e350bd55642198e33613cbbdd Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 20 Feb 2024 02:14:58 +0000 Subject: [PATCH] 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. --- devine/core/manifests/hls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devine/core/manifests/hls.py b/devine/core/manifests/hls.py index 4e09173..8cdcd20 100644 --- a/devine/core/manifests/hls.py +++ b/devine/core/manifests/hls.py @@ -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())