adium 2332:c0caa839631b: Prevent changing the index of an object...

commits at adium.im commits at adium.im
Tue May 26 01:46:23 UTC 2009


details:	http://hg.adium.im/adium/rev/c0caa839631b
revision:	2332:c0caa839631b
author:		Zachary West <zacw at adium.im>
date:		Mon May 25 21:46:14 2009 -0400

Prevent changing the index of an object in a container it doesn't exist in. This is the cause of the hang referenced out-of-the-original-ticket's-reason in #11962 (Refs #11962).

diffstat:

 Frameworks/Adium Framework/Source/AIListObject.m |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 38629538cb0c -r c0caa839631b Frameworks/Adium Framework/Source/AIListObject.m
--- a/Frameworks/Adium Framework/Source/AIListObject.m	Mon May 25 21:38:58 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIListObject.m	Mon May 25 21:46:14 2009 -0400
@@ -207,6 +207,8 @@
 {
 	AIListObject<AIContainingObject> *container = (AIListObject<AIContainingObject> *)self;
 	
+	NSAssert([container.containedObjects containsObject:listObject], @"Asked to set an index for an object which doesn't exist.");
+	
 	if (index == 0) {
 		//Moved to the top of a group.  New index is between 0 and the lowest current index
 		[container listObject:listObject didSetOrderIndex: self.smallestOrder / 2.0];




More information about the commits mailing list