error when removing NPCs

What you expected to happen: removing multiple NPC’s with the Undo Panel (right now i tested only the Combine Soldier/Elite | Manhack | Prison Guard)
What actually happened: NPC’s got removed and this error occured


attempt to call method 'GetSelected' (a nil value)
lua/vgui/dlistbox.lua:159

How we can make the same thing happen: Remove several NPC’s

Sorry if this is a repost.