aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/check_pgsql.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 8d60701f..324bd5f4 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -258,7 +258,7 @@ main (int argc, char **argv)
if (verbose)
printf("Closing connection\n");
PQfinish (conn);
- return (query_status > status) ? query_status : status;
+ return (pgquery && query_status > status) ? query_status : status;
}