I have a code with AngularJS:
service.doSomething() .then(function(result) { //do something with the result });
In AngularJS 1.5.
I have solved this error by adding a default value in the catch block like:
service.doSomething() .then(function(response) { var x = null; var y = x.y; }).catch(function(error) { var y = 0; });
(take in count that I am not an experienced angular developer)