/* get config payload */
if (json_object_object_get_ex(json, section, &jobj)) {
/* make sure we have the correct type */
- if (!json_object_is_type(jobj, json_type_object)) {
+ if ((jobj == NULL) || !json_object_is_type(jobj, json_type_object)) {
/* log error */
RERROR("invalid json type for '%s' section - sections must be json objects", section);
/* reuturn */
/* loop through object */
json_object_object_foreach(jobj, attribute, json_vp) {
/* check for appropriate type in value and op */
- if (!json_object_is_type(json_vp, json_type_object)) {
+ if ((jobj == NULL) || !json_object_is_type(json_vp, json_type_object)) {
/* log error */
RERROR("invalid json type for '%s' attribute - attributes must be json objects",
attribute);
/* create pair from json object */
if (json_object_object_get_ex(json_vp, "value", &jval) &&
json_object_object_get_ex(json_vp, "op", &jop)) {
+ /* check for null before getting type */
+ if (jval == NULL) return NULL;
/* make correct pairs based on json object type */
switch (json_object_get_type(jval)) {
case json_type_double:
DEBUG3("rlm_couchbase: jrows == %s", json_object_to_json_string(jrows));
/* check for valid row value */
- if (!json_object_is_type(jrows, json_type_array) || json_object_array_length(jrows) < 1) {
+ if ((jrows == NULL) || !json_object_is_type(jrows, json_type_array) || json_object_array_length(jrows) < 1) {
/* log error */
ERROR("rlm_couchbase: no valid rows returned from view: %s", vpath);
/* set return */