I’ve been haunted by a mysterious iChat problem for the past week. Once in a while (speak: randomly) iChat would disconnect from all accounts and display an error message, telling me that the iChat Agent unexpectedly quit. I then had to reconnect my accounts manually.
In system.log the following entry caught my attention:
iChatAgent: WARNING: iChatAgent exception caught on main thread: *** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)
Obviously iChat Agent tries to acces an empty array and this throws an exception. After some googleing, I found a post in the Apple Discussion Groups mentioning this crash happens when a buddy connects or disconnects. The solution is as simple as weird. Just remove some buddy and add him again! No problems again for me.