Skip to content
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

fix(scroll): prevent 'cannot read from undefined' exception #4565

Merged
merged 1 commit into from
Dec 6, 2015

Conversation

leobetosouza
Copy link

Sometimes, I don't know why yet, scrollView is undefined and this line rises an Error. This commit fix this problem, but don't fix what makes the scrollView undefined.

@mhartington
Copy link
Contributor

Do you have an example of some markup where you'll get this error? Your change just adds a double check to make sure there is scroll view, but its not clear why that wouldn't be covered by the original

@leobetosouza
Copy link
Author

I'm sorry. But I don't have a specific snippet that generates this error.

I get it in Android 6.0 with chromium 44, using JS Scrolling at the startup. When I switched to native none of my test devices get the error.

I've tried to read the code on ionic.views.Scroll() but (at this moment) understand it is beyond my capabilities.

@igor-slotin
Copy link

+1
I have same issue, and this pull-request fixed it
It happened if data load in controller longer than rendering template

@leobetosouza
Copy link
Author

@igor-slotin @audotto @iltaen @bambriy @GulinSS do you have some code example to share with us?

mlynch added a commit that referenced this pull request Dec 6, 2015
fix(scroll): prevent 'cannot read from undefined' exception
@mlynch mlynch merged commit 5b6e4d6 into ionic-team:master Dec 6, 2015
@mlynch
Copy link
Contributor

mlynch commented Dec 6, 2015

Thanks, seems like a harmless check to add

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.

8 participants