Skip to content

Commit 29b2055

Browse files
committed
skip decoding JSON if query result is None
1 parent d107635 commit 29b2055

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

rejson/client.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ def setDecoder(self, decoder):
9191
self._decoder = decoder
9292

9393
def _decode(self, s, *args, **kwargs):
94-
try:
95-
return self._decoder.decode(s, *args, **kwargs)
96-
except TypeError:
97-
if s is not None:
98-
raise
99-
return None
94+
return self._decoder.decode(s, *args, **kwargs) if s is not None else None
10095

10196
def jsondel(self, name, path=Path.rootPath()):
10297
"""

0 commit comments

Comments
 (0)