Skip to content

Commit

Permalink
FIX: Crash when selecting certain lines in the line management window
Browse files Browse the repository at this point in the history
  • Loading branch information
jamespetts committed Mar 3, 2024
1 parent aad9e68 commit 6b9e888
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gui/line_waiting_status.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,9 @@ void gui_line_waiting_status_t::init()
}
else {
// waypoint or depot
depot_t *depot = world()->lookup(i.pos)->get_depot();
const bool is_waypoint = world()->lookup(i.pos)->get_depot() == NULL;
const grund_t* gr = world()->lookup(i.pos);
depot_t *depot = gr ? gr->get_depot() : nullptr;
const bool is_waypoint = depot == nullptr;
if (is_waypoint) {
new_component<gui_waypoint_box_t>(base_color, line_style, i.pos);
}
Expand All @@ -340,7 +341,7 @@ void gui_line_waiting_status_t::init()
if (show_name) {
gui_label_buf_t *lb = new_component<gui_label_buf_t>(SYSCOL_TEXT_WEAK);
if (is_waypoint) {
const grund_t* gr = world()->lookup(i.pos);

if (gr) {
if (const char *label_text = gr->get_text()) {
lb->buf().printf(" %s", label_text);
Expand Down

0 comments on commit 6b9e888

Please sign in to comment.