upnpx
upnpx copied to clipboard
Crash
Hi, I got a crash report from an user: UPnPDB.m line 317 : Fatal Exception: NSInvalidArgumentException *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
By reading the code, this seems quite impossible
while( [readyForDescription count] > 0){
upnpdevice = readyForDescription[0];
//fill the upnpdevice with info from the XML
int ret = [upnpdevice loadDeviceDescriptionFromXML];
if(ret == 0){
[self lock];
//NSLog(@"httpThread upnpdevice, location=%@", [upnpdevice xmlLocation]);
//This is the only place we add devices to the rootdevices
[rootDevices addObject:upnpdevice];
[self unlock];
}
[readyForDescription removeObjectAtIndex:0];
}
Any idea of what could be the problem ? I guess it has to do with asynchronous update of readyForDescription array ... Between the while test and upnpdevice assignment, readyForDescription may have changed !