diff options
| author | Dan Strokirk <dan.strokirk@gmail.com> | 2021-06-24 17:15:25 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-06-28 11:02:08 +0200 |
| commit | f5ea9aa2f32c7ca9a1fdf793580fddba3daae1b9 (patch) | |
| tree | 663ceceac46833d77dd678d5eba50e95ebdb5679 /django/forms | |
| parent | 66af94d56ea08ccf8d906708a6cc002dd3ab24d3 (diff) | |
Fixed #32807 -- Fixed JSONField crash when redisplaying None values.
Thanks to Alex Hill for the initial patch.
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/fields.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 57886656de..f1275aa387 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -1251,6 +1251,8 @@ class JSONField(CharField): def bound_data(self, data, initial): if self.disabled: return initial + if data is None: + return None try: return json.loads(data, cls=self.decoder) except json.JSONDecodeError: |
