]> git.lizzy.rs Git - cheatdb.git/blobdiff - app/blueprints/github/__init__.py
Fix crash on existing GitHub App Integration
[cheatdb.git] / app / blueprints / github / __init__.py
index c65a68d4d4f695f54d2783be0c4c7c029555d7a1..0049f78fbca580c3cf4e32be371c8cb0d6bbfa92 100644 (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