Handle some edge cases elegantly
This commit is contained in:
parent
7016229885
commit
7d9f8f8d7f
|
@ -75,7 +75,10 @@ class TweetPane(gtk.ScrolledWindow):
|
|||
|
||||
# If this is our first load of this list, don't treat anything as new!
|
||||
if self.last_tweet_read is None:
|
||||
self.last_tweet_read = statuses[0].id
|
||||
try:
|
||||
self.last_tweet_read = statuses[0].id
|
||||
except IndexError:
|
||||
self.last_tweet_read = 0
|
||||
|
||||
# Keep count of the new tweets for posting a status message
|
||||
self.num_new_tweets = 0
|
||||
|
@ -90,7 +93,10 @@ class TweetPane(gtk.ScrolledWindow):
|
|||
else:
|
||||
self.tweets[i].clear_status()
|
||||
|
||||
self.latest_tweet = statuses[0].id
|
||||
try:
|
||||
self.latest_tweet = statuses[0].id
|
||||
except IndexError:
|
||||
self.latest_tweet = 0
|
||||
|
||||
self.update_tab_label()
|
||||
|
||||
|
|
Reference in New Issue
Block a user