Bug 914317 - Add a check to remove title in prompts

check target before accessing its value to make sure the others accessing ModalDialog can work.