r69044 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69043‎ | r69044 | r69045 >
Date:06:21, 5 July 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Add check to prevent Call to a member function getId() on a non-object
Modified paths:
  • /trunk/extensions/Translate/TranslatePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslatePage.php
@@ -252,7 +252,10 @@
253253 $selector = new HTMLSelector( 'task', 'task', $this->options['task'] );
254254
255255 // Check if this is a page translation group to return only appropriate tasks.
256 - $isPageTranslation = strpos( $this->group->getId(), 'page|' ) === 0;
 256+ $isPageTranslation = false;
 257+ if( $this->group ) {
 258+ $isPageTranslation = strpos( $this->group->getId(), 'page|' ) === 0;
 259+ }
257260
258261 foreach ( TranslateTasks::getTasks( $isPageTranslation ) as $id ) {
259262 $label = call_user_func( array( 'TranslateTask', 'labelForTask' ), $id );

Status & tagging log