Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/54869


Change subject: Add null check for property in property lookup
......................................................................

Add null check for property in property lookup

e.g. in case of a deleted property or other reason

Change-Id: I396df7016ccbcff3c5a5cf01d3bf2a708a30181b
---
M lib/includes/store/PropertySQLLookup.php
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/69/54869/1

diff --git a/lib/includes/store/PropertySQLLookup.php 
b/lib/includes/store/PropertySQLLookup.php
index 877c7b3..3a39412 100644
--- a/lib/includes/store/PropertySQLLookup.php
+++ b/lib/includes/store/PropertySQLLookup.php
@@ -73,11 +73,14 @@
                        $statementsByProperty[$propertyId->getNumericId()][] = 
$statement;
 
                        $property = $this->entityLookup->getEntity( $propertyId 
);
-                       $propertyLabel = $property->getLabel( $langCode );
 
-                       if ( $propertyLabel !== false ) {
-                               $id = $property->getPrefixedId();
-                               $propertyList[$id] = $propertyLabel;
+                       if ( $property !== null ) {
+                               $propertyLabel = $property->getLabel( $langCode 
);
+
+                               if ( $propertyLabel !== false ) {
+                                       $id = $property->getPrefixedId();
+                                       $propertyList[$id] = $propertyLabel;
+                               }
                        }
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/54869
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I396df7016ccbcff3c5a5cf01d3bf2a708a30181b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <aude.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to