Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Add guard for this.urlInput
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Nov 1, 2017
1 parent dc72fe3 commit 67e9b00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/renderer/components/navigation/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ class UrlBar extends React.Component {
if (this.props.normalizedSuggestion.startsWith(newValueNormalized) && this.props.normalizedSuggestion.length > 0) {
const newSuffix = this.props.normalizedSuggestion.substring(newValueNormalized.length)
this.setValue(newValue, newSuffix)
this.urlInput.setSelectionRange(newValue.length, newValue.length + newSuffix.length + 1)
if (this.urlInput) {
this.urlInput.setSelectionRange(newValue.length, newValue.length + newSuffix.length + 1)
}
return true
} else {
this.setValue(newValue, '')
Expand Down

0 comments on commit 67e9b00

Please sign in to comment.