Deal with two common places for corrupt Explain database
[idzebra-moved-to-github.git] / index / zinfo.c
index 267d164..9086b6c 100644 (file)
@@ -1,5 +1,5 @@
-/* $Id: zinfo.c,v 1.75 2006-11-27 10:40:33 adam Exp $
-   Copyright (C) 1995-2006
+/* $Id: zinfo.c,v 1.77 2007-02-24 16:47:16 adam Exp $
+   Copyright (C) 1995-2007
    Index Data ApS
 
 This file is part of the Zebra server.
@@ -409,11 +409,23 @@ ZebraExplainInfo zebraExplain_open(
 #endif
        node_tgtinfo = data1_search_tag(zei->dh, zei->data1_target,
                                         "/targetInfo");
+        if (!node_tgtinfo)
+        {
+           yaz_log(YLOG_FATAL, "Node node_tgtinfo missing");
+           nmem_destroy(zei->nmem);
+           return 0;
+        }
        zebraExplain_mergeAccessInfo(zei, node_tgtinfo,
                                      &zei->accessInfo);
 
        node_zebra = data1_search_tag(zei->dh, node_tgtinfo->child,
                                       "zebraInfo");
+        if (!node_zebra)
+        {
+           yaz_log(YLOG_FATAL, "Node node_zebra missing");
+           nmem_destroy(zei->nmem);
+           return 0;
+        }
        np = 0;
        if (node_zebra)
        {