Skip to content

Commit

Permalink
fix(places/SearchBox): undefined child at unmount
Browse files Browse the repository at this point in the history
Google Maps Api error can cause removal of searchBox which can results into an error at unmount while trying to append undefined to containerElement
  • Loading branch information
Hemant-yadav authored and tomchentw committed Dec 14, 2017
1 parent 57a701f commit 0c8e943
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/macros/places/SearchBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ export class SearchBox extends React.PureComponent {
const child = this.context[MAP].controls[
this.props.controlPosition
].removeAt(this.mountControlIndex)
this.containerElement.appendChild(child)
if(child !== undefined){
this.containerElement.appendChild(child)
}
}
}

Expand Down

0 comments on commit 0c8e943

Please sign in to comment.