searchengine/oss/cl/clucene/src/clucene/search/multisearcher.cpp
changeset 2 6c1a2771f4b7
parent 0 671dee74050a
child 15 cf5c74390b98
child 24 65456528cac2
--- a/searchengine/oss/cl/clucene/src/clucene/search/multisearcher.cpp	Mon May 03 13:33:22 2010 +0300
+++ b/searchengine/oss/cl/clucene/src/clucene/search/multisearcher.cpp	Fri May 14 16:57:37 2010 +0300
@@ -190,6 +190,7 @@
 	  _CLDELETE(docs);
     }
 
+	if (hq) {
     int32_t hqlen = hq->size();
 	fieldDocs = _CL_NEWARRAY(FieldDoc*,hqlen);
 	for (j = hqlen - 1; j >= 0; j--)	  // put docs in array
@@ -200,6 +201,9 @@
     _CLDELETE(hq);
 
     return _CLNEW TopFieldDocs (totalHits, fieldDocs, hqlen, hqFields);
+	} else  {
+	   return _CLNEW TopFieldDocs(0, NULL, 0, NULL );
+	}
   }
 
   Query* MultiSearcher::rewrite(Query* original) {