From 1d5515add89e9edc3b1fa90287821e522bfb0de0 Mon Sep 17 00:00:00 2001 From: Anthony Nadaletti Date: Tue, 10 Aug 2021 16:07:11 -0300 Subject: [PATCH] Update getRequestHeaders to always return an object --- GooglePlacesAutocomplete.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/GooglePlacesAutocomplete.js b/GooglePlacesAutocomplete.js index e1bed09..cd03253 100644 --- a/GooglePlacesAutocomplete.js +++ b/GooglePlacesAutocomplete.js @@ -124,11 +124,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => { }; const getRequestHeaders = (requestUrl) => { - if (requestUrl) { - return requestUrl.headers; - } else { - return {}; - } + return requestUrl?.headers || {}; }; const setRequestHeaders = (request, headers) => {