Skip to content

Commit

Permalink
Avoid crash when no proficiencies in character menu (#75370)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Roguecop and github-actions[bot] authored Aug 4, 2024
1 parent 9247c4b commit 874dded
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/player_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,9 @@ static bool handle_player_display_action( Character &you, unsigned int &line,
}
case player_display_tab::proficiencies:
const std::vector<display_proficiency> 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" ) {
Expand Down

0 comments on commit 874dded

Please sign in to comment.