Skip to content

fix(src/withGoogleMap): crash when google is not defined#867

Open
ToLi91 wants to merge 1 commit into
tomchentw:masterfrom
scandiblue:master
Open

fix(src/withGoogleMap): crash when google is not defined#867
ToLi91 wants to merge 1 commit into
tomchentw:masterfrom
scandiblue:master

Conversation

@ToLi91

@ToLi91 ToLi91 commented Jul 13, 2018

Copy link
Copy Markdown

PLEASE CHECK "Allow edits from maintainers"

help

FOLLOW "Conventional Commits Specification" FOR ALL COMMITS

https://conventionalcommits.org/

@ToLi91

ToLi91 commented Jul 13, 2018

Copy link
Copy Markdown
Author

This will fix so a whole site does not crash when the google-maps script is not loaded, making window.google undefined.

Fix for Issues: #745 and #797

@Piemontez

Piemontez commented Jul 17, 2018

Copy link
Copy Markdown

The withGoogleMap function doesn't prevent "google is not loaded" error.

I proposed a solution to this in
https://github.com/Piemontez/react-google-maps/blob/patch-1/src/withGoogleMap.jsx : 59.

In my case, my system operates offline too and this crash is right.

@ToLi91

ToLi91 commented Jul 22, 2018

Copy link
Copy Markdown
Author

That will only work if the variable google has been defined to a falsely state. I have the problem where google is not yet defined due to that I did not allow the google maps js to load (NoScript).

I think both of these solutions are very good improvements which solves two different problems.

@mauriciosfriso

Copy link
Copy Markdown

It seems to be the same problem that #811. There it was solved

@ToLi91

ToLi91 commented Aug 13, 2018

Copy link
Copy Markdown
Author

@mauriciosfriso yes this is very true!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants