}
$title = Title::newFromText( $part1, $ns );
- $checkVariantLink = sizeof($wgContLang->getVariants())>1;
- # Check for language variants if the template is not found
- if($checkVariantLink && $title->getArticleID() == 0){
- $wgContLang->findVariantLink($part1, $title);
- }
if ( !is_null( $title ) ) {
+ $checkVariantLink = sizeof($wgContLang->getVariants())>1;
+ # Check for language variants if the template is not found
+ if($checkVariantLink && $title->getArticleID() == 0){
+ $wgContLang->findVariantLink($part1, $title);
+ }
+
if ( !$title->isExternal() ) {
# Check for excessive inclusion
$dbk = $title->getPrefixedDBkey();