mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Add an IncompletableObject exception (#1227)
If a returned object from GitHub does not include an URL, that object can not be completed, and used to fail with an obscure traceback saying NoneType has no method startswith. Check for this, and raise IncompletableObject instead.
This commit is contained in:
@@ -266,6 +266,8 @@ class CompletableGithubObject(GithubObject):
|
||||
self.__complete()
|
||||
|
||||
def __complete(self):
|
||||
if self._url.value is None:
|
||||
raise GithubException.IncompletableObject(400, "Returned object contains no URL")
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self._url.value
|
||||
|
||||
Reference in New Issue
Block a user