Skip to content

Commit

Permalink
Fix: need exists, else may throw an error if value is a map
Browse files Browse the repository at this point in the history
  • Loading branch information
simar0at committed Oct 5, 2023
1 parent 06b1460 commit aba6a1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vleserver/api-problem.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ declare function _:trace-info($description as xs:string, $trace-result as map(xs
(: map {$description||'@sum': sum($trace-result?value?timings?*?*)}, :)
for $v at $i in $trace-result?value return for $t in array:flatten($v?timings) return map:keys($t)!map{$description||'->'||.: $t(.)})}}
else
if ($trace-result?value instance of map(*) and $trace-result?value?value)
if ($trace-result?value instance of map(*) and exists($trace-result?value?value))
(: We have a map as value :)
then map{'value': $trace-result?value?value,
'timings': array{($preceding-timings, map {$description: $trace-result?time},
Expand Down

0 comments on commit aba6a1d

Please sign in to comment.