diff --git a/src/armor_layers.cpp b/src/armor_layers.cpp index 803a3c5c1d458..492ceafc3a549 100644 --- a/src/armor_layers.cpp +++ b/src/armor_layers.cpp @@ -1105,7 +1105,7 @@ void outfit::sort_armor( Character &guy ) // wear the item std::optional::iterator> new_equip_it = guy.wear( obtained ); - if( new_equip_it ) { + if( new_equip_it && !tmp_worn.empty() ) { // save iterator to cursor's position std::list::iterator cursor_it = tmp_worn[leftListIndex]; item &item_to_check = *cursor_it; @@ -1116,7 +1116,7 @@ void outfit::sort_armor( Character &guy ) // reorder `worn` vector to place new item at cursor worn.splice( cursor_it, worn, *new_equip_it ); } - } else if( guy.is_npc() ) { + } else if( guy.is_npc() && !tmp_worn.empty() ) { // TODO: Pass the reason here popup( _( "Can't put this on!" ) ); }