From bd30d6bfa8e2e817bec4134700a38b012c0293eb Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 25 May 2006 02:35:24 +0000 Subject: [PATCH] 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 --- src/libstack/osrf_application.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 -- 2.11.0