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:
Steve Kowalik
2019-09-23 16:40:06 +10:00
committed by GitHub
parent 850da5af27
commit f91cbac2e3
3 changed files with 14 additions and 0 deletions
+2
View File
@@ -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