Fixed #2260: _removeByComponent method have bad "if"

_removeByComponent method have bad "if"