summaryrefslogtreecommitdiff
path: root/ext/yaz
diff options
context:
space:
mode:
authorAdam Dickmeiss <dickmeiss@php.net>2001-02-20 11:40:36 +0000
committerAdam Dickmeiss <dickmeiss@php.net>2001-02-20 11:40:36 +0000
commit4c04c755ddf913632db77987db9ddbb64fdb9100 (patch)
treea8b7ebc259de10a34e18ed162136966414e4f219 /ext/yaz
parent3bfea1e6275da6e79de786c3672793fc8f385a84 (diff)
downloadphp-git-4c04c755ddf913632db77987db9ddbb64fdb9100.tar.gz
Yet another bug fix regarding present.
Diffstat (limited to 'ext/yaz')
-rw-r--r--ext/yaz/php_yaz.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/yaz/php_yaz.c b/ext/yaz/php_yaz.c
index 5f34077675..f82a2f4970 100644
--- a/ext/yaz/php_yaz.c
+++ b/ext/yaz/php_yaz.c
@@ -372,14 +372,17 @@ static void handle_records (Yaz_Association t, Z_Records *sr,
NMEM nmem = odr_extract_mem (t->odr_in);
Z_NamePlusRecordList *p =
sr->u.databaseOrSurDiagnostics;
- for (j = 0; j < t->resultSets->recordList->num_records; j++)
+ if (t->resultSets->recordList)
+ {
+ for (j = 0; j < t->resultSets->recordList->num_records; j++)
if (!t->resultSets->recordList->records[j])
break;
- for (i = 0; i<p->num_records; i++)
- t->resultSets->recordList->records[i+j] = p->records[i];
- /* transfer our response to search_nmem .. we need it later */
- nmem_transfer (t->resultSets->odr->mem, nmem);
- nmem_destroy (nmem);
+ for (i = 0; i<p->num_records; i++)
+ t->resultSets->recordList->records[i+j] = p->records[i];
+ /* transfer our response to search_nmem .. we need it later */
+ nmem_transfer (t->resultSets->odr->mem, nmem);
+ nmem_destroy (nmem);
+ }
if (present_phase && p->num_records == 0)
{
/* present response and we didn't get any records! */