mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Prevent 'cannot read' exception
On Android (4.4.4) I'm getting "Cannot read property 'options' of null" each time, 100% reproducible. This small check will not hurt anyone but will prevent unhandled exception error.
This commit is contained in:
17
js/angular/controller/scrollController.js
vendored
17
js/angular/controller/scrollController.js
vendored
@@ -41,14 +41,15 @@ function($scope, scrollViewOptions, $timeout, $window, $$scrollValueCache, $loca
|
||||
|
||||
if (!angular.isDefined(scrollViewOptions.bouncing)) {
|
||||
ionic.Platform.ready(function() {
|
||||
scrollView.options.bouncing = true;
|
||||
|
||||
if(ionic.Platform.isAndroid()) {
|
||||
// No bouncing by default on Android
|
||||
scrollView.options.bouncing = false;
|
||||
// Faster scroll decel
|
||||
scrollView.options.deceleration = 0.95;
|
||||
} else {
|
||||
if (scrollView.options) {
|
||||
scrollView.options.bouncing = true;
|
||||
if(ionic.Platform.isAndroid()) {
|
||||
// No bouncing by default on Android
|
||||
scrollView.options.bouncing = false;
|
||||
// Faster scroll decel
|
||||
scrollView.options.deceleration = 0.95;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user