if ( 0 != $id ) { return $id; }
$fname = 'LinkCache::addLinkObj';
+ global $wgProfiler;
+ if ( isset( $wgProfiler ) ) {
+ $fname .= ' (' . $wgProfiler->getCurrentSection() . ')';
+ }
+
wfProfileIn( $fname );
$ns = $nt->getNamespace();
}
function addObj( $title ) {
- $this->add( $title->getNamespace(), $title->getDBkey() );
+ if ( is_object( $title ) ) {
+ $this->add( $title->getNamespace(), $title->getDBkey() );
+ } else {
+ wfDebug( "Warning: LinkBatch::addObj got invalid title object\n" );
+ }
}
function add( $ns, $dbkey ) {