summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/box.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/render/box.c b/render/box.c
index e707e680f..64b225bce 100644
--- a/render/box.c
+++ b/render/box.c
@@ -2925,8 +2925,9 @@ struct box *box_object_at_point(struct content *c, int x, int y)
return object_box;
}
+
/**
- * Find a box based upon its id attribute
+ * Find a box based upon its id attribute.
*
* \param box box to search
* \param id id to look for
@@ -2936,11 +2937,11 @@ struct box *box_find_by_id(struct box *box, const char *id)
{
struct box *a, *b;
- if (strcmp(id, box->id) == 0)
+ if (box->id != NULL && strcmp(id, box->id) == 0)
return box;
for (a = box->children; a; a = a->next) {
- if ((b = box_find_by_id(a, id)) != 0)
+ if ((b = box_find_by_id(a, id)) != NULL)
return b;
}