From 2aea4a7d09275d607895c0a72f263990b6e097cc Mon Sep 17 00:00:00 2001 From: Ven Korolev Date: Wed, 24 Nov 2021 23:00:06 +0100 Subject: [PATCH] Bump 2.6.1 --- lib/usePlacesWidget.js | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/usePlacesWidget.js b/lib/usePlacesWidget.js index d6fae55..65ab254 100644 --- a/lib/usePlacesWidget.js +++ b/lib/usePlacesWidget.js @@ -95,7 +95,10 @@ function usePlacesWidget(props) { if (_utils.isBrowser && window.MutationObserver && inputRef.current && inputRef.current instanceof HTMLInputElement) { observerHack.current = new MutationObserver(function () { observerHack.current.disconnect(); - inputRef.current.autocomplete = inputAutocompleteValue; + + if (inputRef.current) { + inputRef.current.autocomplete = inputAutocompleteValue; + } }); observerHack.current.observe(inputRef.current, { attributes: true, diff --git a/package.json b/package.json index 973b11a..36e7060 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-google-autocomplete", - "version": "2.6.0", + "version": "2.6.1", "description": "React component for google autocomplete.", "main": "index.js", "types": "index.d.ts",