Skip to content

Commit 265f36f

Browse files
committed
Fix to_bytes when text is None
1 parent 48085c9 commit 265f36f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: flask_oauthlib/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ def extract_params():
2121

2222
def to_bytes(text, encoding='utf-8'):
2323
"""Make sure text is bytes type."""
24+
if not text:
25+
return text
2426
if not isinstance(text, bytes_type):
2527
text = text.encode(encoding)
2628
return text

0 commit comments

Comments
 (0)