From a489ae17fbd05902a8bba45343677bdeaf5aaf7c Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Sun, 19 Oct 2025 19:47:52 +0200 Subject: [PATCH] check invalid file content --- cbz/page.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cbz/page.py b/cbz/page.py index 4f1a635..cfbfbbc 100644 --- a/cbz/page.py +++ b/cbz/page.py @@ -75,6 +75,8 @@ class PageInfo(PageModel): data = base64.b64decode(data) if not isinstance(data, bytes): raise ValueError(f'Expecting Bytes or Base64 input, got {data!r}') + if not data.strip(): + raise ValueError(f'Empty or null data provided (length={len(data)})') return cls(data, **kwargs) @classmethod