Fix for bug 7045: check whether a selector matches a non-editor

check whether a selector matches a non-editor to prevent removing all editors in that case