mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-27 09:43:06 +00:00
Check for null after Title::newFromText
Title::newFromText returns null on invalid title. Change-Id: Iaef69584eff33b1b13669f8d0a3b8eeeba3755cc
This commit is contained in:
parent
abbc5c5e32
commit
cf8538086c
|
@ -468,9 +468,7 @@ class CategoryTree {
|
|||
foreach ( $res as $row ) {
|
||||
$title = Title::newFromText( $row->page_title, $row->page_namespace );
|
||||
// Page name could have slashes, check the subpage for valid language built-in codes
|
||||
$isValidLangCode = $title->getSubpageText();
|
||||
|
||||
if ( $title !== null && $isValidLangCode ) {
|
||||
if ( $title !== null && $title->getSubpageText() ) {
|
||||
$lb->addObj( $title->getBaseTitle() );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue