From: miker Date: Sun, 29 Apr 2007 20:11:51 +0000 (+0000) Subject: Exiting with a usable error message rather than segfaulting X-Git-Tag: osrf_rel_2_0_1~1036 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4165f167f2a0fdaeaae67663944d454067057314;p=OpenSRF.git Exiting with a usable error message rather than segfaulting - patch provided by Scott McKellar - http://list.georgialibraries.org/pipermail/open-ils-dev/2007-April/000727.html git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@866 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/libstack/osrf_settings.c b/src/libstack/osrf_settings.c index 96127d9..fa8d98e 100644 --- a/src/libstack/osrf_settings.c +++ b/src/libstack/osrf_settings.c @@ -12,6 +12,14 @@ char* osrf_settings_host_value(char* format, ...) { jsonObject* osrf_settings_host_value_object(char* format, ...) { VA_LIST_TO_STRING(format); + + if( ! config ) { + const char * msg = "config pointer is NULL"; + fprintf( stderr, "osrf_settings_host_value_object: %s\n", msg ); + osrfLogError( OSRF_LOG_MARK, msg ); + exit( 99 ); + } + return jsonObjectFindPath(config->config, VA_BUF); }