From 46426f1196af7ec4cb7fcbc645158626cd2a042d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 12 Sep 2018 15:59:01 +0100 Subject: [PATCH] Fix segfault when routing. Fixes: lp:1792037 * https://bugs.launchpad.net/kicad/+bug/1792037 --- pcbnew/router/router_preview_item.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/router_preview_item.cpp b/pcbnew/router/router_preview_item.cpp index ac344ae6de..83748d7fc1 100644 --- a/pcbnew/router/router_preview_item.cpp +++ b/pcbnew/router/router_preview_item.cpp @@ -130,8 +130,11 @@ const BOX2I ROUTER_PREVIEW_ITEM::ViewBBox() const switch( m_type ) { case PR_SHAPE: - bbox = m_shape->BBox(); - bbox.Inflate( m_width / 2 ); + if( m_shape ) + { + bbox = m_shape->BBox(); + bbox.Inflate( m_width / 2 ); + } return bbox; case PR_POINT: