commit - fc6936c9e0f166ad38902a6d7e68571f109129ba
commit + a1c776dd13ef4d9d3b3dc2ed3d25f8f478c9a27f
blob - 91a8779dd612ffeb72a140d5f5a8978d1d731b30
blob + 7cf47e144675e585c282ee0fd081af37fc6b4e77
--- oracle.c
+++ oracle.c
log_errx(1, "Cannot open %s\n", path);
}
- oracles = json_object_object_get(root, "Oracles");
+ if (!json_object_object_get_ex(root, "Oracles", &oracles)) {
+ log_debug("Cannot find a [Oracles] array in %s\n", path);
+ return;
+ }
+
n_oracles = json_object_array_length(oracles);
log_debug("number of oracles: %d\n", n_oracles);
log_errx(1, "Cannot open %s\n", path);
}
- oracles = json_object_object_get(root, "Oracles");
+ if (!json_object_object_get_ex(root, "Oracles", &oracles)) {
+ log_debug("Cannot find a [Oracles] array in %s\n", path);
+ return;
+ }
+
n_oracles = json_object_array_length(oracles);
log_debug("number of oracles: %d\n", n_oracles);
log_errx(1, "Cannot open %s\n", path);
}
- oracles = json_object_object_get(root, "Oracles");
+ if (!json_object_object_get_ex(root, "Oracles", &oracles)) {
+ log_debug("Cannot find a [Oracles] array in %s\n", path);
+ return;
+ }
+
n_oracles = json_object_array_length(oracles);
log_debug("number of oracles: %d\n", n_oracles);
log_errx(1, "Cannot open %s\n", path);
}
- oracles = json_object_object_get(root, "Oracles");
+ if (!json_object_object_get_ex(root, "Oracles", &oracles)) {
+ log_debug("Cannot find a [Oracles] array in %s\n", path);
+ return;
+ }
+
n_oracles = json_object_array_length(oracles);
log_debug("number of oracles: %d\n", n_oracles);
log_errx(1, "Cannot open %s\n", path);
}
- oracles = json_object_object_get(root, "Oracles");
+ if (!json_object_object_get_ex(root, "Oracles", &oracles)) {
+ log_debug("Cannot find a [Oracles] array in %s\n", path);
+ return;
+ }
+
n_oracles = json_object_array_length(oracles);
log_debug("number of oracles: %d\n", n_oracles);