From 4ad9aa8449bb6e6a31ccb153132c6e34067450cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 27 Apr 2020 19:59:26 +0200 Subject: [PATCH] parser: Don't crash on links to invalid titles Bug: T251045 Change-Id: I1a7b8b9b34d38ec4e3edc12687bdf99bb0e61bd8 --- modules/parser.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/parser.js b/modules/parser.js index 0bb063b80..973f59603 100644 --- a/modules/parser.js +++ b/modules/parser.js @@ -502,6 +502,9 @@ function findSignature( timestampNode, until ) { return false; } mwTitle = mw.Title.newFromText( title ); + if ( !mwTitle ) { + return false; + } if ( mwTitle.getNamespaceId() === mw.config.get( 'wgNamespaceIds' ).user || mwTitle.getNamespaceId() === mw.config.get( 'wgNamespaceIds' ).user_talk