summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/libpq/fe-exec.c')
-rw-r--r--src/interfaces/libpq/fe-exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 8895f81add1..a1c946bccd2 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2091,8 +2091,9 @@ PQgetResult(PGconn *conn)
res = pqPrepareAsyncResult(conn);
/* Advance the queue as appropriate */
- pqCommandQueueAdvance(conn, false,
- res->resultStatus == PGRES_PIPELINE_SYNC);
+ if (res)
+ pqCommandQueueAdvance(conn, false,
+ res->resultStatus == PGRES_PIPELINE_SYNC);
if (conn->pipelineStatus != PQ_PIPELINE_OFF)
{