*/
function getPrevious() {
$prev = $this->mTitle->getPreviousRevisionID( $this->mId );
- return Revision::newFromTitle( $this->mTitle, $prev );
+ if ( $prev ) {
+ return Revision::newFromTitle( $this->mTitle, $prev );
+ } else {
+ return null;
+ }
}
/**
*/
function getNext() {
$next = $this->mTitle->getNextRevisionID( $this->mId );
- return Revision::newFromTitle( $this->mTitle, $next );
+ if ( $next ) {
+ return Revision::newFromTitle( $this->mTitle, $next );
+ } else {
+ return null;
+ }
}
/**#@-*/