Fix crash when using invert selection on with empty view