adium-1.4 3288:c2eab99da7ce: Just like in the patch from our ano...

commits at adium.im commits at adium.im
Wed Nov 24 18:32:11 UTC 2010


details:	http://hg.adium.im/adium-1.4/rev/c2eab99da7ce
revision:	3288:c2eab99da7ce
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Wed Nov 24 19:28:21 2010 +0100

Just like in the patch from our anonymous source, log a lot but don't assert when adding nil via addObject:.

Refs #14229.
(transplanted from 1cd209516587e3f0c1c9e37610675ba412ae24bf)

diffs (16 lines):

diff -r 22fb5f71ee72 -r c2eab99da7ce Frameworks/Adium Framework/Source/AIXMLElement.m
--- a/Frameworks/Adium Framework/Source/AIXMLElement.m	Sun Nov 21 21:00:40 2010 -0600
+++ b/Frameworks/Adium Framework/Source/AIXMLElement.m	Wed Nov 24 19:28:21 2010 +0100
@@ -217,7 +217,11 @@
 - (void)addObject:(id)obj
 {
 	//Warn but don't assert if null is added.  Adding nothing is a no-op, but we may want to investigate where this is happening further.
-	if (!obj) NSLog(@"Warning: Attempted to add (null) to %@", obj);
+	if (!obj) {
+		AILog(@"Attempted to add null to AIXMLElement %@, backtrace available in debug mode", obj);
+		AILogBacktrace();
+		return;
+	}
 
 	BOOL isString = [obj isKindOfClass:[NSString class]];
 	NSAssert2((isString || [obj isKindOfClass:[AIXMLElement class]]), @"%@: addObject: %@ is of incorrect class",self,obj);




More information about the commits mailing list