emuikernel / wittytwitter

Automatically exported from code.google.com/p/wittytwitter
1 stars 0 forks source link

Witty throws an unhandled exception when receiving a new tweet #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run witty
2. when a new tweet comes in witty throws an exception (Index out of range)

StackTrace: 
            at System.ThrowHelper.ThrowArgumentOutOfRangeException() 
            at System.Collections.Generic.List`1.get_Item(Int32 index) 
            at 
System.Collections.ObjectModel.Collection`1.get_Item(Int32 index) 
            at Witty.MainWindow.UpdateUserInterface(TweetCollection 
newTweets) in C:\Users\omars\SourceCode\Witty\Witty 
\MainWindow.xaml.cs:line 233 

Because you are looping backwards through the 
newTweets, you are trying to call tweets[i].UpdateRelativeTime(); when 
i < the count of the items in tweets. The newTweet does not get added 
to the tweets collection till you get to 0. 

I have attached a patch with a fix I made. 

Original issue reported on code.google.com by shahi...@gmail.com on 5 Dec 2007 at 1:30

Attachments:

GoogleCodeExporter commented 8 years ago
Omar, 

You fix works without fail here.  Thx!

Matt Ortiz | email: matt[at]footheory[dot]com | twitter: @mortiz

Original comment by ma77or...@gmail.com on 4 Jan 2008 at 8:34

GoogleCodeExporter commented 8 years ago
thanks Omar, sorry it took so long to apply your patches.

Original comment by alan...@gmail.com on 31 Jan 2008 at 5:44

GoogleCodeExporter commented 8 years ago
marking as fixed

Original comment by alan...@gmail.com on 31 Jan 2008 at 5:49