Skip to content

Commit

Permalink
Fix hard crash on missng skosxl:literalForm
Browse files Browse the repository at this point in the history
If skosxl:literalForm is missing on a label resource the $label variable remains uninitialzed and causes a hard crash
  • Loading branch information
semanticfire authored Jan 13, 2018
1 parent 8ab9cdd commit 1ef321e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/Concept.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function getXlLabel()
$labels = $this->resource->allResources('skosxl:prefLabel');
foreach($labels as $labres) {
$label = $labres->getLiteral('skosxl:literalForm');
if ($label->getLang() == $this->clang) {
if ($label !== null && $label->getLang() == $this->clang) {
return new LabelSkosXL($this->model, $labres);
}
}
Expand Down

0 comments on commit 1ef321e

Please sign in to comment.