bugfix: make sure destination has not already been removed from connection
This commit is contained in:
parent
316f154c1f
commit
8fc7bc10cd
1 changed files with 4 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: RadioConnection.java,v 1.8 2009/04/01 23:33:05 fros4943 Exp $
|
* $Id: RadioConnection.java,v 1.9 2009/05/04 15:34:28 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja;
|
package se.sics.cooja;
|
||||||
|
@ -118,7 +118,9 @@ public class RadioConnection {
|
||||||
*/
|
*/
|
||||||
public void removeDestination(Radio radio) {
|
public void removeDestination(Radio radio) {
|
||||||
int idx = destinations.indexOf(radio);
|
int idx = destinations.indexOf(radio);
|
||||||
|
if (idx < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
destinations.remove(idx);
|
destinations.remove(idx);
|
||||||
destinationDelays.remove(idx);
|
destinationDelays.remove(idx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue