Skip to content

Commit 0613e58

Browse files
committed
Proper error strings when NULL
1 parent b535590 commit 0613e58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

confluent_kafka/src/confluent_kafka.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,10 @@ PyObject *KafkaError_new0 (rd_kafka_resp_err_t err, const char *fmt, ...) {
258258
PyObject *KafkaError_new_or_None (rd_kafka_resp_err_t err, const char *str) {
259259
if (!err)
260260
Py_RETURN_NONE;
261-
return KafkaError_new0(err, "%s", str);
261+
if (str)
262+
return KafkaError_new0(err, "%s", str);
263+
else
264+
return KafkaError_new0(err, NULL);
262265
}
263266

264267

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy