Skip to content

Commit

Permalink
ensure to return a string
Browse files Browse the repository at this point in the history
when $eventualTitles is the empty sequence.
  • Loading branch information
peterstadler committed Jan 10, 2025
1 parent 6ce8986 commit 3a1d8be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions add/data/xql/getLinkTarget.xql
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ declare function local:getWindowTitle($doc as document-node()?, $type as xs:stri
for $t in $doc//*:title return
$t => normalize-space()
)

return $eventualTitles[1]
(: ensure to return a string when $eventualTitles is the empty sequence :)
return $eventualTitles[1] => string()

else
('[No title found!]')
Expand Down

0 comments on commit 3a1d8be

Please sign in to comment.