upnpx icon indicating copy to clipboard operation
upnpx copied to clipboard

Crash

Open sylverb opened this issue 9 years ago • 0 comments

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 !

sylverb avatar Dec 19 '15 14:12 sylverb