Need to set `editor = null;` since you're comparing against `null` below.