From 39b46dc55fe4207c0ea180f8b23a692bf3debe21 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Mon, 7 Jul 2014 18:58:00 +0200 Subject: [PATCH] Consequences of 3656:ee3c7f3d964f. Deal with the fact that some subdocs may not have a filename field at all --- src/query/recollq.cpp | 5 +++++ tests/pythonapi/simple.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/query/recollq.cpp b/src/query/recollq.cpp index 46882412..76cc5d2f 100644 --- a/src/query/recollq.cpp +++ b/src/query/recollq.cpp @@ -381,6 +381,11 @@ endopts: string titleorfn = doc.meta[Rcl::Doc::keytt]; if (titleorfn.empty()) titleorfn = doc.meta[Rcl::Doc::keyfn]; + if (titleorfn.empty()) { + string url; + printableUrl(rclconfig->getDefCharset(), doc.url, url); + titleorfn = path_getsimple(url); + } char cpc[20]; sprintf(cpc, "%d", doc.pc); diff --git a/tests/pythonapi/simple.py b/tests/pythonapi/simple.py index 54691ee9..ddb9fd2b 100644 --- a/tests/pythonapi/simple.py +++ b/tests/pythonapi/simple.py @@ -7,6 +7,8 @@ else: ISP3 = False def utf8string(s): + if s is None: + return "None" if ISP3: return s else: