Catch AIOOB in upnp code (triggered in I2P Android on shutdown)

This commit is contained in:
str4d
2014-08-30 02:38:27 +00:00
parent 5decf18eb5
commit 0f7a3dba87

View File

@@ -292,7 +292,14 @@ public class ControlPoint implements HTTPRequestListener
DeviceList devList = new DeviceList();
int nRoots = devNodeList.size();
for (int n=0; n<nRoots; n++) {
Node rootNode = devNodeList.getNode(n);
// AIOOB was thrown from here, maybe would be better to
// copy the list before traversal?
Node rootNode;
try {
rootNode = devNodeList.getNode(n);
} catch (ArrayIndexOutOfBoundsException aioob) {
break;
}
Device dev = getDevice(rootNode);
if (dev == null)
continue;