From 653341115f1cb1e2e9515da1b8cea6e9e4e8e0d7 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 4 Jun 2020 16:52:56 +0300 Subject: [PATCH] Chunks: add stricter validation. --- django_etesync/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django_etesync/serializers.py b/django_etesync/serializers.py index 1f5d3c2..c940d6e 100644 --- a/django_etesync/serializers.py +++ b/django_etesync/serializers.py @@ -91,6 +91,8 @@ class ChunksField(serializers.RelatedField): return (obj.uid, ) def to_internal_value(self, data): + if data[0] is None or data[1] is None: + raise serializers.ValidationError('null is not allowed') return (data[0], b64decode(data[1]))