summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticResultFormats/formats/filtered/src/View/TableView.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticResultFormats/formats/filtered/src/View/TableView.php')
-rw-r--r--www/wiki/extensions/SemanticResultFormats/formats/filtered/src/View/TableView.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/www/wiki/extensions/SemanticResultFormats/formats/filtered/src/View/TableView.php b/www/wiki/extensions/SemanticResultFormats/formats/filtered/src/View/TableView.php
index c1f6b0b2..7f3c7664 100644
--- a/www/wiki/extensions/SemanticResultFormats/formats/filtered/src/View/TableView.php
+++ b/www/wiki/extensions/SemanticResultFormats/formats/filtered/src/View/TableView.php
@@ -86,12 +86,12 @@ class TableView extends View {
private function getTableHeaders() {
$headers = [];
- /**
- * Get first QueryResult and assign array members to variables
- *
- * @var \SRF\Filtered\ResultItem $queryResultValue
- */
- list( , $queryResultValue ) = each( $this->getQueryResults() );
+ $queryResults = $this->getQueryResults();
+ $queryResultValue = reset( $queryResults );
+
+ if ( !is_a( $queryResultValue, ResultItem::class ) ) {
+ return '';
+ }
foreach ( $queryResultValue->getValue() as $field ) {
$printRequest = $field->getPrintRequest();