Permalink
Browse files

Fixed part of issue #290.

  • Loading branch information...
1 parent 505cd66 commit df10148501ec369e7c47f36269bd4d912e57f752 @Poincare Poincare committed Aug 8, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 flask/wrappers.py
View
@@ -90,7 +90,7 @@ def blueprint(self):
@cached_property
def json(self):
"""If the mimetype is `application/json` this will contain the
- parsed JSON data.
+ parsed JSON data. Returns None if the the mimetype is incorrect.
"""
if __debug__:
_assert_have_json()
@@ -99,6 +99,8 @@ def json(self):
if request_charset is not None:
return json.loads(self.data, encoding=request_charset)
return json.loads(self.data)
+ else:
+ return None
def _load_form_data(self):
RequestBase._load_form_data(self)

0 comments on commit df10148

Please sign in to comment.