From 26fea403c268d7b18a457c7509192fa99c92631d Mon Sep 17 00:00:00 2001 From: Piotr Miazga Date: Fri, 3 May 2019 11:19:04 +0200 Subject: [PATCH] Harden Definitions::insertCommunityPortal() method Looks like Title::newFromText() can return null instead of Title object. Code has to support this edge case. Bug: T222407 Change-Id: Ie34a26303df8e27247e51ddc2b13e3c2fa59a435 --- includes/menu/Definitions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/menu/Definitions.php b/includes/menu/Definitions.php index 66c04fd92..fc776c322 100644 --- a/includes/menu/Definitions.php +++ b/includes/menu/Definitions.php @@ -309,7 +309,7 @@ final class Definitions { return; } $title = Title::newFromText( $titleName ); - if ( !$title->exists() ) { + if ( $title === null || !$title->exists() ) { return; }