Unnecessary check in replace logic

pointless check in if statement, we've already ascertained
that either there is no object, or that the length is 0 anyway.
Merge pull request #3505 from kingpin2k/removeExtraRemoveLogic

Unnecessary check in replace logic