Fix crash when no scenario is present on one side

master
Daniel Zaoui 5 years ago
parent dc891a41e1
commit 0c30b92bc6
  1. 19
      src/bin/inspect.c

@ -358,6 +358,8 @@ _scn_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
Exactness_Action *a1 = vv->p1;
Exactness_Action *a2 = vv->p2;
if (!a1 ^ !a2) return strdup("XXXXX");
if (a1->timestamp != a2->timestamp) eina_strbuf_append_printf(buf, "["LDIFF(%.3f)"/"RDIFF(%.3f)"]: ", a1->timestamp/1000.0, a2->timestamp/1000.0);
else eina_strbuf_append_printf(buf, "%.3f: ", a1->timestamp / 1000.0);
@ -467,7 +469,7 @@ _scn_content_get(void *data, Evas_Object *gl, const char *part)
_Compare_Item_Data *vv = data;
Exactness_Action *v1 = vv->p1;
Exactness_Action *v2 = vv->p2;
if (v1->type == EXACTNESS_ACTION_TAKE_SHOT &&
if (v1 && v2 && v1->type == EXACTNESS_ACTION_TAKE_SHOT &&
v2->type == EXACTNESS_ACTION_TAKE_SHOT)
{
Eo *gl1 = eina_list_nth(_gls, 0);
@ -951,10 +953,9 @@ _gui_unit_display(Exactness_Unit *unit1, Exactness_Unit *unit2)
itr1 = unit1 ? unit1->actions : NULL;
itr2 = unit2 ? unit2->actions : NULL;
if (itr1)
elm_genlist_item_append(gl1, _grp_itc, (void *)EX_SCENARIO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
if (itr2)
if (itr1 || itr2)
{
elm_genlist_item_append(gl1, _grp_itc, (void *)EX_SCENARIO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_append(gl2, _grp_itc, (void *)EX_SCENARIO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_append(glc, _grp_itc, (void *)EX_SCENARIO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
}
@ -986,10 +987,9 @@ _gui_unit_display(Exactness_Unit *unit1, Exactness_Unit *unit2)
itr1 = unit1 ? unit1->imgs : NULL;
itr2 = unit2 ? unit2->imgs : NULL;
if (itr1)
elm_genlist_item_append(gl1, _grp_itc, (void *)EX_IMAGE, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
if (itr2)
if (itr1 || itr2)
{
elm_genlist_item_append(gl1, _grp_itc, (void *)EX_IMAGE, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_append(gl2, _grp_itc, (void *)EX_IMAGE, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_append(glc, _grp_itc, (void *)EX_IMAGE, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
}
@ -1025,10 +1025,9 @@ _gui_unit_display(Exactness_Unit *unit1, Exactness_Unit *unit2)
itr1 = unit1 ? unit1->objs : NULL;
itr2 = unit2 ? unit2->objs : NULL;
if (itr1)
elm_genlist_item_append(gl1, _grp_itc, (void *)EX_OBJ_INFO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
if (itr2)
if (itr1 || itr2)
{
elm_genlist_item_append(gl1, _grp_itc, (void *)EX_OBJ_INFO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_append(gl2, _grp_itc, (void *)EX_OBJ_INFO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_append(glc, _grp_itc, (void *)EX_OBJ_INFO, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
}

Loading…
Cancel
Save