Fix posible nullpointer
Fix for issue #1340. Remove item from Variable selection does not work