Skip to content

fix: added a typeof check to prevent crash without internet connection #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mauriciosfriso
Copy link

@mauriciosfriso mauriciosfriso commented Mar 22, 2018

When there isn´t a internet connection, the app crash.

@Simek
Copy link
Contributor

Simek commented Apr 12, 2018

I think we should check also if maps in google is available.
Rewriting check to if(!google || !google.maps) should be enough.

@mauriciosfriso
Copy link
Author

I check your code and does't works. I getting: google is not defined.
if you will check remember delete browser cache

@Simek
Copy link
Contributor

Simek commented Apr 12, 2018

@mauriciosfriso Sorry for wrong example, my mistake, conditions in my example should be reversed.
if(google && google.maps).

@mauriciosfriso
Copy link
Author

mauriciosfriso commented Apr 12, 2018

@Simek I see your mistake, but anyway it's not works. I keep getting:

google is not defined

therefore I check the google's type

sorry for my English

@Simek
Copy link
Contributor

Simek commented Apr 13, 2018

I've dig a little bit into this problem. Seems that google is set to be an identifier until script loads. This causes !google check to throw "undefined" error so your code comparing type is correct way to check this. And don't worry about your english. It's fine.

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.

2 participants