http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89980

Revision: 89980
Author:   mkroetzsch
Date:     2011-06-13 16:57:36 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
check for null where null might occur

Modified Paths:
--------------
    trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Property.php

Modified: 
trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Property.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Property.php  
2011-06-13 16:44:26 UTC (rev 89979)
+++ trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Property.php  
2011-06-13 16:57:36 UTC (rev 89980)
@@ -186,19 +186,39 @@
        }
 
        public function getShortWikiText( $linked = null ) {
-               return $this->isVisible() ? $this->highlightText( 
$this->getWikiPageValue()->getShortWikiText( $linked ) ) : '';
+               if ( $this->isVisible() ) {
+                       $wikiPageValue = $this->getWikiPageValue();
+                       return is_null( $wikiPageValue ) ? '' : 
$this->highlightText( $wikiPageValue->getShortWikiText( $linked ) );
+               } else {
+                       return '';
+               }
        }
 
        public function getShortHTMLText( $linker = null ) {
-               return $this->isVisible() ? $this->highlightText( 
$this->getWikiPageValue()->getShortHTMLText( $linker ) ) : '';
+               if ( $this->isVisible() ) {
+                       $wikiPageValue = $this->getWikiPageValue();
+                       return is_null( $wikiPageValue ) ? '' : 
$this->highlightText( $wikiPageValue->getShortHTMLText( $linked ) );
+               } else {
+                       return '';
+               }
        }
 
        public function getLongWikiText( $linked = null ) {
-               return $this->isVisible() ? $this->highlightText( 
$this->getWikiPageValue()->getLongWikiText( $linked ) ) : '';
+               if ( $this->isVisible() ) {
+                       $wikiPageValue = $this->getWikiPageValue();
+                       return is_null( $wikiPageValue ) ? '' : 
$this->highlightText( $wikiPageValue->getLongWikiText( $linked ) );
+               } else {
+                       return '';
+               }
        }
 
        public function getLongHTMLText( $linker = null ) {
-               return $this->isVisible() ? $this->highlightText( 
$this->getWikiPageValue()->getLongHTMLText( $linker ) ) : '';
+               if ( $this->isVisible() ) {
+                       $wikiPageValue = $this->getWikiPageValue();
+                       return is_null( $wikiPageValue ) ? '' : 
$this->highlightText( $wikiPageValue->getLongHTMLText( $linked ) );
+               } else {
+                       return '';
+               }
        }
 
        public function getWikiValue() {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to