mw.widgets.CategorySelector: Avoid JS exceptions for invalid user input
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 4 Jul 2016 18:42:54 +0000 (20:42 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Mon, 4 Jul 2016 18:52:27 +0000 (20:52 +0200)
commit3ef6aa0728f66bc163b9522210d9e53105bf78bd
treeef5dbd5693168d299853798641a2b8644b841086
parent7e57732470fb3553b1d66a02cab9381b6c5068e9
mw.widgets.CategorySelector: Avoid JS exceptions for invalid user input

Previously, if the user entered a category name that was not a valid title,
we'd pass `null` to CategoryCapsuleItemWidget constructor, which would then
fail with 'TypeError: Cannot read property 'getMainText' of null'.

Depends on Ifb016e1d2c73ae701cbce4505583e48769fd4ed6 in OOjs UI.

Bug: T136238
Change-Id: I7446d85bce37a4bd9398e2d258aa2f6dc0e593a8
resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js