protect against null params to transforms in SQL
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Mar 2008 02:38:06 +0000 (02:38 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Mar 2008 02:38:06 +0000 (02:38 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9113 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_cstore.c

index 5057586..6b4692c 100644 (file)
@@ -1184,7 +1184,9 @@ static char* searchFieldTransform (const char* class, osrfHash* field, const jso
 
                        char* val = jsonObjectToSimpleString(func_item);
 
-                           if ( dbi_conn_quote_string(dbhandle, &val) ) {
+                           if ( !val ) {
+                           buffer_add( sql_buf, ",NULL" );
+                           } else if ( dbi_conn_quote_string(dbhandle, &val) ) {
                            buffer_fadd( sql_buf, ",%s", val );
                        } else {
                                osrfLogError(OSRF_LOG_MARK, "%s: Error quoting key string [%s]", MODULENAME, val);