Skip to content

Commit

Permalink
Fix to_bytes when text is None
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Dec 20, 2013
1 parent 48085c9 commit 265f36f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flask_oauthlib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def extract_params():

def to_bytes(text, encoding='utf-8'):
"""Make sure text is bytes type."""
if not text:
return text
if not isinstance(text, bytes_type):
text = text.encode(encoding)
return text
Expand Down

0 comments on commit 265f36f

Please sign in to comment.