Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/92596


Change subject: Fix crash in mw.page.watch.updateWatchLink() when title not set
......................................................................

Fix crash in mw.page.watch.updateWatchLink() when title not set

.attr( 'title' ) returns undefined when the title attribute isn't set,
and calling .match() on undefined doesn't work so well.

Reported by Roger457 on IRC.

Change-Id: Ie7f374bd212dcea28947db671d977126d9747f50
---
M resources/mediawiki.page/mediawiki.page.watch.ajax.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/92596/1

diff --git a/resources/mediawiki.page/mediawiki.page.watch.ajax.js 
b/resources/mediawiki.page/mediawiki.page.watch.ajax.js
index 545cd07..24986ef 100644
--- a/resources/mediawiki.page/mediawiki.page.watch.ajax.js
+++ b/resources/mediawiki.page/mediawiki.page.watch.ajax.js
@@ -22,7 +22,7 @@
                // message keys 'watch', 'watching', 'unwatch' or 'unwatching'.
                msgKey = state === 'loading' ? action + 'ing' : action;
                otherAction = action === 'watch' ? 'unwatch' : 'watch';
-               accesskeyTip = $link.attr( 'title' ).match( 
mw.util.tooltipAccessKeyRegexp );
+               accesskeyTip = $link.attr( 'title' ) && $link.attr( 'title' 
).match( mw.util.tooltipAccessKeyRegexp );
                $li = $link.closest( 'li' );
 
                /**

-- 
To view, visit https://gerrit.wikimedia.org/r/92596
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie7f374bd212dcea28947db671d977126d9747f50
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to