summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-10-22 11:04:07 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-10-22 11:04:07 (GMT)
commit7c16c6f9774949e1b638b99e3c6ae6e570385e45 (patch)
tree392040a33c271f8477666b2fe2fd5fc87e56ecec /gui
parentefbe6faae10cefd8b0834c31ca613cb314f07da9 (diff)
downloadeeshow-7c16c6f9774949e1b638b99e3c6ae6e570385e45.zip
eeshow-7c16c6f9774949e1b638b99e3c6ae6e570385e45.tar.gz
eeshow-7c16c6f9774949e1b638b99e3c6ae6e570385e45.tar.bz2
gui/comp.c (add_comp_aoi): don't crash if component is undefined
Diffstat (limited to 'gui')
-rw-r--r--gui/comp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gui/comp.c b/gui/comp.c
index d5d4487..095c7f7 100644
--- a/gui/comp.c
+++ b/gui/comp.c
@@ -208,10 +208,15 @@ static void add_doc(void *user, const char *tag, const char *s)
void add_comp_aoi(struct gui_sheet *sheet, const struct sch_obj *obj)
{
- const struct dwg_bbox bbox = get_bbox(obj);
+ struct dwg_bbox bbox;
struct comp_aoi_ctx *ctx = alloc_type(struct comp_aoi_ctx);
const struct comp_field *f;
+ if (!obj->u.comp.comp)
+ return;
+
+ bbox = get_bbox(obj);
+
struct aoi cfg = {
.x = bbox.x,
.y = bbox.y,