From faf03683e11e94175db39055ad6547037fb1fb9a Mon Sep 17 00:00:00 2001 From: scottmk Date: Tue, 11 Aug 2009 18:49:43 +0000 Subject: [PATCH] In doCreate(): check for a NULL pointer as a field value, and report it by class and field name. git-svn-id: svn://svn.open-ils.org/ILS/trunk@13813 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/c-apps/oils_cstore.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index 5365c6adfc..65be642b9f 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -1501,6 +1501,28 @@ static jsonObject* doCreate(osrfMethodContext* ctx, int* err ) { value = jsonObjectToSimpleString( field_object ); } + if( ! value ) { + osrfAppSessionStatus( + ctx->session, + OSRF_STATUS_BADREQUEST, + "osrfMethodException", + ctx->request, + "No value available for column" + ); + osrfLogError( + OSRF_LOG_MARK, + "%s: NULL value for field %s of class %s", + MODULENAME, + field_name, + osrfHashGet(meta, "classname") + ); + osrfHashIteratorFree( field_itr ); + buffer_free( val_buf ); + buffer_free( col_buf ); + buffer_free( table_buf ); + *err = -1; + return jsonNULL; + } if (first) { first = 0; -- 2.11.0