range.getBoundingClientRect check for null, fixes #580