Index: trunk/extensions/LiquidThreads/classes/LqtThread.php |
— | — | @@ -557,14 +557,18 @@ |
558 | 558 | function article() { |
559 | 559 | if ( $this->article ) return $this->article; |
560 | 560 | |
561 | | - $title = Title::newFromID( $this->articleId ); |
562 | | - if ( $title ) { |
563 | | - $a = new Article( $title ); |
| 561 | + if ( !is_null( $this->articleId ) ) { |
| 562 | + $title = Title::newFromID( $this->articleId ); |
| 563 | + if ( $title ) { |
| 564 | + $article = new Article( $title ); |
| 565 | + } |
564 | 566 | } |
565 | | - if ( isset( $a ) && $a->exists() ) { |
566 | | - return $a; |
| 567 | + if ( isset( $article ) && $article->exists() ) { |
| 568 | + $this->article = $article; |
| 569 | + return $article; |
567 | 570 | } else { |
568 | | - return new Article( Title::makeTitle( $this->articleNamespace, $this->articleTitle ) ); |
| 571 | + $title = Title::makeTitle( $this->articleNamespace, $this->articleTitle ); |
| 572 | + return new Article( $title ); |
569 | 573 | } |
570 | 574 | } |
571 | 575 | |