mirror of
https://github.com/hyugogirubato/cbz.git
synced 2026-09-26 13:31:00 +00:00
check invalid file content
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user