Skip to content

Commit 51cebd1

Browse files
authored
Merge pull request #78 from BCLab-UNM/hotfix-gui-segfault-on-close
Don't crash on close when popout map is open
2 parents 6f5ac0f + 135d96b commit 51cebd1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rqt_rover_gui/src/MapFrame.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,10 @@ void MapFrame::paintEvent(QPaintEvent* event) {
516516
else painter.setPen(Qt::yellow);
517517

518518
pair<float,float> current_coordinate;
519-
current_coordinate = map_data->getEKFPath(rover_to_display)->back();
519+
if(! map_data->getEKFPath(rover_to_display)->empty() )
520+
{
521+
current_coordinate = map_data->getEKFPath(rover_to_display)->back();
522+
}
520523

521524
float x = map_origin_x+((current_coordinate.first-min_seen_x)/max_seen_width)*(map_width-map_origin_x);
522525
float y = map_origin_y+((current_coordinate.second-min_seen_y)/max_seen_height)*(map_height-map_origin_y);

0 commit comments

Comments
 (0)