Skip to content

Commit

Permalink
fix rare crash when unfavoriting an item twice (cataclysmbnteam#2180)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoCottret authored Nov 26, 2022
1 parent a4bab60 commit 82b62d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/inventory_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,10 @@ void inventory_column::on_input( const inventory_input &input )
} else if( input.action == "END" ) {
select( entries.size() - 1, scroll_direction::BACKWARD );
} else if( input.action == "TOGGLE_FAVORITE" ) {
const item_location &loc = get_selected().any_item();
set_stack_favorite( loc, !loc->is_favorite );
if( !get_selected().locations.empty() ) {
const item_location &loc = get_selected().any_item();
set_stack_favorite( loc, !loc->is_favorite );
}
}
}

Expand Down

0 comments on commit 82b62d6

Please sign in to comment.