From: miker Date: Thu, 25 May 2006 02:35:24 +0000 (+0000) Subject: allow a null param element if argc is 0 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bd30d6bfa8e2e817bec4134700a38b012c0293eb;p=opensrf%2Fbjwebb.git allow a null param element if argc is 0 git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@731 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/libstack/osrf_application.h b/src/libstack/osrf_application.h index c62aebb..0f58e43 100644 --- a/src/libstack/osrf_application.h +++ b/src/libstack/osrf_application.h @@ -26,10 +26,12 @@ if(!d) return -1; \ if(!d->session) { osrfLogError( OSRF_LOG_MARK, "Session is NULL in app reqeust" ); return -1; }\ if(!d->method) { osrfLogError( OSRF_LOG_MARK, "Method is NULL in app reqeust" ); return -1; }\ - if(!d->params) { osrfLogError( OSRF_LOG_MARK, "Params is NULL in app reqeust %s", d->method->name ); return -1; }\ - if( d->params->type != JSON_ARRAY ) { \ - osrfLogError( OSRF_LOG_MARK, "'params' is not a JSON array for method %s", d->method->name);\ - return -1; }\ + if(d->method->argc) {\ + if(!d->params) { osrfLogError( OSRF_LOG_MARK, "Params is NULL in app reqeust %s", d->method->name ); return -1; }\ + if( d->params->type != JSON_ARRAY ) { \ + osrfLogError( OSRF_LOG_MARK, "'params' is not a JSON array for method %s", d->method->name);\ + return -1; }\ + }\ if( !d->method->name ) { osrfLogError( OSRF_LOG_MARK, "Method name is NULL"); return -1; } #ifdef OSRF_LOG_PARAMS