Without this check first I was getting crashes in the case of contentEditable.