Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -110,6 +110,10 @@ |
111 | 111 | |
112 | 112 | static function linkInContextData( $thread, $contextType = 'page' ) { |
113 | 113 | $query = array(); |
| 114 | + |
| 115 | + if ( ! $thread ) { |
| 116 | + throw new MWException( "Null thread passed to linkInContextData" ); |
| 117 | + } |
114 | 118 | |
115 | 119 | if ( $contextType == 'page' ) { |
116 | 120 | $title = clone $thread->article()->getTitle(); |
— | — | @@ -1901,6 +1905,10 @@ |
1902 | 1906 | array( 'id' => 'lqt-thread-sortkey-' . $thread->id() ) |
1903 | 1907 | ); |
1904 | 1908 | } |
| 1909 | + |
| 1910 | + if ( ! $thread->title() ) { |
| 1911 | + throw new MWException( "Thread ".$thread->id()." has null title" ); |
| 1912 | + } |
1905 | 1913 | |
1906 | 1914 | // Add the thread's title |
1907 | 1915 | $html .= Xml::hidden( |
Index: trunk/extensions/LiquidThreads/classes/Thread.php |
— | — | @@ -1302,7 +1302,9 @@ |
1303 | 1303 | } |
1304 | 1304 | |
1305 | 1305 | function rootRevision() { |
1306 | | - if ( !$this->isHistorical() || !isset( $this->topmostThread()->threadRevision ) ) { |
| 1306 | + if ( !$this->isHistorical() || |
| 1307 | + !isset( $this->topmostThread()->threadRevision ) || |
| 1308 | + ! $this->root() ) { |
1307 | 1309 | return null; |
1308 | 1310 | } |
1309 | 1311 | |
Index: trunk/extensions/LiquidThreads/pages/ThreadPermalinkView.php |
— | — | @@ -28,6 +28,10 @@ |
29 | 29 | unset( $content_actions['viewsource'] ); |
30 | 30 | unset( $content_actions['talk'] ); |
31 | 31 | |
| 32 | + if ( ! $view->thread->title() ) { |
| 33 | + throw new MWException( "Thread ".$view->thread->id()." has null title" ); |
| 34 | + } |
| 35 | + |
32 | 36 | $subpage = $view->thread->title()->getPrefixedText(); |
33 | 37 | |
34 | 38 | // Repoint move/delete/history tabs |
Index: trunk/extensions/LiquidThreads/api/ApiFeedLQTThreads.php |
— | — | @@ -179,6 +179,10 @@ |
180 | 180 | $root = new Article( Title::newFromText( $thread ) ); |
181 | 181 | $thread = Threads::withRoot( $root ); |
182 | 182 | |
| 183 | + if ( ! $thread ) { |
| 184 | + continue; |
| 185 | + } |
| 186 | + |
183 | 187 | $threadCond = array( |
184 | 188 | 'thread_ancestor' => $thread->id(), |
185 | 189 | 'thread_id' => $thread->id() |