File tree 1 file changed +9
-4
lines changed
src/processing/mode/android 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -308,10 +308,15 @@ private void addDevice(final Device device) {
308
308
309
309
310
310
void deviceRemoved (final Device device ) {
311
- // System.err.println("AndroidEnvironment: removing " + device.getId());
312
- if (devices .remove (device .getId ()) == null ) {
313
- throw new IllegalStateException ("I didn't know about device "
314
- + device .getId () + "!" );
311
+ String id = device .getId ();
312
+ if (devices .containsKey (id )) {
313
+ devices .remove (device .getId ());
314
+ } else {
315
+ // TODO: Device already removed, don't throw exception as this seems to
316
+ // happen quite often when removing a device, perhaps shutdown() gets
317
+ // called twice?
318
+ // throw new IllegalStateException("I didn't know about device "
319
+ // + device.getId() + "!");
315
320
}
316
321
}
317
322
You can’t perform that action at this time.
0 commit comments