Skip to content

Commit

Permalink
Adjust for change to ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Sep 9, 2021
1 parent 14eac78 commit c777186
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function searchConcepts($params)
try {
$hitvoc = $this->getVocabularyByGraph($hit['graph']);
$hit['vocab'] = $hitvoc->getId();
} catch (Exception $e) {
} catch (ValueError $e) {
trigger_error($e->getMessage(), E_USER_WARNING);
$hitvoc = null;
$hit['vocab'] = "???";
Expand All @@ -255,7 +255,7 @@ public function searchConcepts($params)

$hit['voc'] = $hitvoc;

if (!$hitvoc->containsURI($hit['uri'])) {
if ($hitvoc === null || !$hitvoc->containsURI($hit['uri'])) {
// if uri is a external vocab uri that is included in the current vocab
$realvoc = $this->guessVocabularyFromURI($hit['uri'], $voc !== null ? $voc->getId() : null);
if ($realvoc !== $hitvoc) {
Expand Down

0 comments on commit c777186

Please sign in to comment.