RCFilters: Only attempt to remove tag if we can find an item for it
authorKosta Harlan <kharlan@wikimedia.org>
Tue, 26 Jun 2018 20:24:11 +0000 (16:24 -0400)
committerRoan Kattouw <roan.kattouw@gmail.com>
Wed, 27 Jun 2018 00:10:37 +0000 (17:10 -0700)
commitabeb8dc28468f436e8b3ea663a5739714f810137
tree84519474cd3d57f4c60de22714346ae5c29a898f
parent198f9a41785e7d3fce11f1f35980e1bfe3a85161
RCFilters: Only attempt to remove tag if we can find an item for it

As noted in T198140 and T198231, removeTagByData leads us eventually to
OO.ui.mixin.GroupElement.prototype.removeItems(), which does not check if
any of the items are null values, and a change event is emitted.

This commit ensures that we can find an item for the data before attempting
to remove the tag.

Bug: T198140
Change-Id: I79a923a7b4e5f6c4d14fcce3c5855b4c56796384
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js