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:
Eugene OZ
2014-11-04 16:07:31 +03:00
parent dfcbef1a03
commit 63d1f26e55

View File

@@ -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 {
}
}
});
}