From 6cae8e81564b9348c9754000c9ae09894cb746a4 Mon Sep 17 00:00:00 2001 From: eltbus <33374178+eltbus@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:21:35 +0100 Subject: [PATCH] Add None check --- multipart/multipart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipart/multipart.py b/multipart/multipart.py index ea8ccca..170151f 100644 --- a/multipart/multipart.py +++ b/multipart/multipart.py @@ -304,7 +304,7 @@ def __eq__(self, other: object) -> bool: return NotImplemented def __repr__(self) -> str: - if len(self.value) > 97: + if self.value is not None and len(self.value) > 97: # We get the repr, and then insert three dots before the final # quote. v = repr(self.value[:97])[:-1] + "...'"