if (static_cast<int>(json_array_get_int_element(array, elem2)) == 1)
dimInfo.SetValidIndex(elem2);
}
-
- topNumber = static_cast<int>(json_object_get_int_member(pObject, "top_number"));
+ if (json_object_has_member(pObject, "top_number"))
+ topNumber = static_cast<int>(
+ json_object_get_int_member(pObject, "top_number"));
LOGI("top number: %d", topNumber);
- threshold = static_cast<double>(json_object_get_double_member(pObject, "threshold"));
+ if (json_object_has_member(pObject, "threshold"))
+ threshold = static_cast<double>(
+ json_object_get_double_member(pObject, "threshold"));
LOGI("threshold: %1.3f", threshold);
try {