r64406 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64405‎ | r64406 | r64407 >
Date:21:16, 30 March 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added error check
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_LinkUtils.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_LinkUtils.inc
@@ -79,8 +79,12 @@
8080 $property = SMWPropertyValue::makeProperty($prop_smw_id);
8181 $res = $store->getPropertyValues($title, $property);
8282 $form_names = array();
83 - foreach ($res as $wiki_page_value)
84 - $form_names[] = $wiki_page_value->getTitle()->getText();
 83+ foreach ($res as $wiki_page_value) {
 84+ $form_title = $wiki_page_value->getTitle();
 85+ if ( ! is_null( $form_title ) ) {
 86+ $form_names[] = $form_title->getText();
 87+ }
 88+ }
8589 // if we're using a non-English language, check for the English string as well
8690 if (! class_exists('SF_LanguageEn') || ! $sfgContLang instanceof SF_LanguageEn) {
8791 $backup_property = SMWPropertyValue::makeProperty($backup_prop_smw_id);

Status & tagging log