r111314 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111313‎ | r111314 | r111315 >
Date:18:56, 12 February 2012
Author:mkroetzsch
Status:deferred
Tags:
Comment:
check type before accessing method, since object can indeed lack this method in rare cases
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStore.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStore.php
@@ -253,7 +253,11 @@
254254 */
255255 protected function deleteSparqlData( SMWExpResource $expResource ) {
256256 $resourceUri = SMWTurtleSerializer::getTurtleNameForExpElement( $expResource );
257 - $extraNamespaces = array( $expResource->getNamespaceId() => $expResource->getNamespace() );
 257+ if ( $expResource instanceof SMWExpNsResource ) {
 258+ $extraNamespaces = array( $expResource->getNamespaceId() => $expResource->getNamespace() );
 259+ } else {
 260+ $extraNamespaces = array();
 261+ }
258262 $masterPageProperty = SMWExporter::getSpecialNsResource( 'swivt', 'masterPage' );
259263 $masterPagePropertyUri = SMWTurtleSerializer::getTurtleNameForExpElement( $masterPageProperty );
260264