python-tent-client
python-tent-client copied to clipboard
Crashes when supplied entity not a Tent entity
_discoverAPIUrls() blows up if it doesn't find any profile URLs, because there are repeated references to profileUrls[0] (the first on tentapp.py line 319), without checking if profileUrls is non-empty. I think the fix would be:
if len(profileUrls) < 1:
raise DiscoveryFailure("No profile URLs found at {0}").format(entityUrl)
right before trying to use profileUrls[0].
It looks like there is a check for IndexError to try to account for this case, but the IndexError will never happen.