From ae73e01c3854e860947665c5a3e0c3d778ce5257 Mon Sep 17 00:00:00 2001 From: Farruh Sheripov Date: Mon, 15 Jan 2024 09:49:30 +0100 Subject: [PATCH] fix object of type 'NoneType' has no len() --- django_google_structured_logger/middlewares.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django_google_structured_logger/middlewares.py b/django_google_structured_logger/middlewares.py index 0528d02..d2cf566 100644 --- a/django_google_structured_logger/middlewares.py +++ b/django_google_structured_logger/middlewares.py @@ -214,6 +214,8 @@ def complete_mask(value): return "...FULL_MASKED..." def partial_mask(value): + if not value: + return value length = len(value) if length <= 4: return complete_mask(value)