fix(util-registry): handle negative indices correctly

This commit is contained in:
Sarah Vaupel 2021-08-24 10:44:24 +02:00
parent a5e666d155
commit cbc03f57c5

View File

@ -106,7 +106,7 @@ export class UtilRegistry {
}
let utilIndex = this._activeUtilInstancesWrapped.indexOf(util);
util.destroy();
this._activeUtilInstancesWrapped.splice(utilIndex, 1);
if (utilIndex >= 0) this._activeUtilInstancesWrapped.splice(utilIndex, 1);
});
}