From 874dded9fcf39295c011a2214c056d51cbedc8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Cort=C3=A9s?= <46103835+Roguecop@users.noreply.github.com> Date: Mon, 5 Aug 2024 01:49:38 +0200 Subject: [PATCH] Avoid crash when no proficiencies in character menu (#75370) * Avoid crash when no proficiencies in character menu Avoid crash when no proficiencies in character menu and we press enter over proficiencies * Update src/player_display.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/player_display.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/player_display.cpp b/src/player_display.cpp index d2e267b4e1718..630d89008556b 100644 --- a/src/player_display.cpp +++ b/src/player_display.cpp @@ -1409,7 +1409,9 @@ static bool handle_player_display_action( Character &you, unsigned int &line, } case player_display_tab::proficiencies: const std::vector profs = you.display_proficiencies(); - show_proficiencies_window( you, profs[line].id ); + if( !profs.empty() ) { + show_proficiencies_window( you, profs[line].id ); + } break; } } else if( action == "CHANGE_PROFESSION_NAME" ) {