From deb761881fc4979db1e87f79289990bfb28f571a Mon Sep 17 00:00:00 2001 From: Zhilkin Serg Date: Sat, 29 May 2021 02:48:53 +0300 Subject: [PATCH] Fix crash when dropping items (#49055) --- src/character.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/character.cpp b/src/character.cpp index 3e30fc389f685..f6489839f5d02 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -3267,7 +3267,7 @@ void Character::drop( const drop_locations &what, const tripoint &target, const cata::optional vp = get_map().veh_at( target ).part_with_feature( "CARGO", false ); if( rl_dist( pos(), target ) > 1 || !( stash || get_map().can_put_items( target ) ) - || vp->part().is_cleaner_on() ) { + || ( vp.has_value() && vp->part().is_cleaner_on() ) ) { add_msg_player_or_npc( m_info, _( "You can't place items here!" ), _( " can't place items here!" ) ); return;