Skip to content

Commit

Permalink
Prevent empty JSON body from causing None error in git config endpoint (
Browse files Browse the repository at this point in the history
#959)

* Prevent empty JSON body from causing None error in git config endpoint

* Apply suggestions from code review

Co-authored-by: Frédéric Collonval <[email protected]>
  • Loading branch information
DarkmatterVale and fcollonval authored Jun 24, 2021
1 parent ceab42b commit c5e09cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jupyterlab_git/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ async def post(self, path: str = ""):
"""
POST get (if no options are passed) or set configuration options
"""
data = self.get_json_body()
data = self.get_json_body() or {}
options = data.get("options", {})

filtered_options = {k: v for k, v in options.items() if k in ALLOWED_OPTIONS}
Expand Down

0 comments on commit c5e09cb

Please sign in to comment.