Bug 1027463 - Check for element before clearing. r=kgrandon