diff --git a/flask_oauthlib/utils.py b/flask_oauthlib/utils.py index 6a93390c..1b8f0aee 100644 --- a/flask_oauthlib/utils.py +++ b/flask_oauthlib/utils.py @@ -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