From fcf01f4bc020cef8a3805c81a8d44aea99f93bb7 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Wed, 11 Sep 2024 13:41:14 +0200 Subject: [PATCH] Replace `jsonVal` block with nwbib version (#1951) --- web/app/views/tags/result_field.scala.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/app/views/tags/result_field.scala.html b/web/app/views/tags/result_field.scala.html index c36bbf0582..a8c899a2cc 100644 --- a/web/app/views/tags/result_field.scala.html +++ b/web/app/views/tags/result_field.scala.html @@ -6,9 +6,10 @@ @import java.util.Optional @import controllers.resources.Lobid -@jsonVal(p: String) = @{ node match { - case Some(node) => node - case None => if ((doc \\ p).isEmpty) (doc \ p) else (doc \\ p).head +@jsonVal(p: String) = @{ + node match { + case Some(node) => (node \ p).asOpt[JsValue].getOrElse(node \ p) + case None => if ((doc \\ p).isEmpty) (doc \ p) else (doc \\ p).head } }