Skip to content

Commit 55aff54

Browse files
committed
check, that DataItem != null
1 parent bb3103e commit 55aff54

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Diff for: SemanticDependencyUpdater.hooks.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
<?php
2-
/**
3-
* Created by PhpStorm.
4-
* User: Sebastian
5-
* Date: 21.08.2018
6-
* Time: 08:56
7-
*/
82

93
namespace SDU;
104

@@ -90,12 +84,15 @@ public static function onAfterDataUpdateComplete( SMWStore $store, SMWSemanticDa
9084

9185
$dataItem = $newData->getPropertyValues( $properties[$wgSDUProperty] );
9286

93-
foreach ( $dataItem as $valueItem ) {
94-
Hooks::updatePagesMatchingQuery( $valueItem->getString() );
87+
if ( $dataItem != null ) {
88+
foreach ( $dataItem as $valueItem ) {
89+
Hooks::updatePagesMatchingQuery( $valueItem->getString() );
90+
}
9591
}
9692

9793
return true;
9894
}
95+
9996
/**
10097
* @param string $queryString Query string, excluding [[ and ]] brackets
10198
*/

0 commit comments

Comments
 (0)