From 4165f167f2a0fdaeaae67663944d454067057314 Mon Sep 17 00:00:00 2001 From: miker Date: Sun, 29 Apr 2007 20:11:51 +0000 Subject: [PATCH] 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 --- src/libstack/osrf_settings.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); } -- 2.11.0