Don't crash when the log index failed to initialize when trying to delete a log, just bail.
authorThijs Alkemade <thijsalkemade@gmail.com>
Fri, 13 Jan 2012 20:53:50 +0100
changeset 4505c0dcb2b73496
parent 4504 1690862014c7
child 4506 f272f5b32043
Don't crash when the log index failed to initialize when trying to delete a log, just bail.

Fixes #15771, refs #13586
Source/AILoggerPlugin.m
     1.1 --- a/Source/AILoggerPlugin.m	Fri Jan 13 13:40:13 2012 +0200
     1.2 +++ b/Source/AILoggerPlugin.m	Fri Jan 13 20:53:50 2012 +0100
     1.3 @@ -517,6 +517,11 @@
     1.4  	dispatch_group_async(loggerPluginGroup, defaultDispatchQueue, blockWithAutoreleasePool(^{
     1.5  		SKIndexRef logSearchIndex = [bself logContentIndex];
     1.6  		
     1.7 +        if (!logSearchIndex) {
     1.8 +            AILogWithSignature(@"AILoggerPlugin warning: logSearchIndex is NULL, but we wanted to remove documents.");
     1.9 +            return;
    1.10 +        }
    1.11 +
    1.12  		for (NSString *logPath in paths) {
    1.13  			SKDocumentRef document = SKDocumentCreateWithURL((CFURLRef)[NSURL fileURLWithPath:logPath]);
    1.14  			if (document) {