Merge pull request #5514 from jaredevantabor/defaults-null-pointer-exception

Extra check to prevent console error
This commit is contained in:
Jared Tabor 2017-02-22 13:19:30 -08:00 committed by GitHub
commit 87a3481fcb

View File

@ -12,7 +12,9 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', '
else {
// steps through the current tree of $state configurations, grabs default search params
defaults = _.find($state.$current.path, (step) => {
return step.params.hasOwnProperty(`${$scope.iterator}_search`);
if(step && step.params && step.params.hasOwnProperty(`${$scope.iterator}_search`)){
return step.params.hasOwnProperty(`${$scope.iterator}_search`);
}
}).params[`${$scope.iterator}_search`].config.value;
}