Skip to content

Commit

Permalink
Fix a crash when trying to link a tile out of the map
Browse files Browse the repository at this point in the history
The client was crashing when Ctrl+Alt+clicking outside of the map (this
shortcut is bound to the "create link" action). Check that we're within bounds
before attempting anything.

Coverity CID 1490725.
  • Loading branch information
lmoureaux committed Jul 30, 2022
1 parent 213dd59 commit 55336e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/mapctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ void map_view::shortcut_pressed(shortcut_id id)
break;

case SC_MAKE_LINK:
queen()->chat->make_link(ptile);
if (ptile != nullptr) {
queen()->chat->make_link(ptile);
}
break;

case SC_BUY_MAP:
Expand Down

0 comments on commit 55336e7

Please sign in to comment.