CID#736182 guard against a dubious call from SearchAndReplace()

Change-Id: I6ce1b577c377721b882c1f8ec757a61e600ae671