Fix crash on existing GitHub App Integration

This commit is contained in:
rubenwardy 2020-01-25 03:09:59 +00:00
parent 19a626e237
commit a15f1ac223
1 changed files with 2 additions and 1 deletions

View File

@ -235,7 +235,8 @@ def handleMakeWebhook(gh_user, gh_repo, package, oauth, event, token):
return False
for hook in r.json():
if hook["config"]["url"] == data["config"]["url"]:
if hook.get("config") and hook["config"].get("url") and \
hook["config"]["url"] == data["config"]["url"]:
flash("Failed to create webhook, as it already exists", "danger")
return False