Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Jan 8, 2025
1 parent 40105b2 commit d2bd93a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/client/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ PyObject *AerospikeClient_Truncate(AerospikeClient *self, PyObject *args,
return NULL;
}

if (!self || !self->as) {
as_error_update(&err, AEROSPIKE_ERR_PARAM, "Invalid aerospike object");
goto CLEANUP;
}
if (!self->is_conn_16) {
as_error_update(&err, AEROSPIKE_ERR_CLUSTER,
"No connection to aerospike cluster");
goto CLEANUP;
}

// Start conversion of the namespace parameter
if (PyUnicode_Check(py_ns)) {
namespace = strdup((char *)PyUnicode_AsUTF8(py_ns));
Expand Down

0 comments on commit d2bd93a

Please sign in to comment.