python-tent-client icon indicating copy to clipboard operation
python-tent-client copied to clipboard

Crashes when supplied entity not a Tent entity

Open graue opened this issue 13 years ago • 0 comments

_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.

graue avatar Dec 06 '12 07:12 graue