Make it work even on imports when title is null.

Change-Id: I75acf8860d15f5f47f16e1f35a5ea07cc88bac85
This commit is contained in:
MarkAHershberger 2013-05-10 20:31:10 -04:00
parent 3a5e47a7af
commit 836963a1b5

View file

@ -51,7 +51,11 @@ class VoteHooks {
$type = intval( $args['type'] );
}
$articleID = $wgOut->getTitle()->getArticleID();
$output = null;
$title = $wgOut->getTitle();
if( $title ) {
$articleID = $title->getArticleID();
switch( $type ) {
case 0:
$vote = new Vote( $articleID );
@ -64,6 +68,7 @@ class VoteHooks {
}
$output = $vote->display();
}
wfProfileOut( __METHOD__ );