Skip to content

Commit

Permalink
Merge pull request #36 from paivaric/master
Browse files Browse the repository at this point in the history
Fix null exception on function $routeSegment.contains
  • Loading branch information
artch committed May 8, 2014
2 parents 1e238d0 + 50366e4 commit 990982b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-route-segment",
"version": "1.2.3",
"version": "1.2.4",
"main": "build/angular-route-segment.js",
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion build/angular-route-segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ angular.module( 'route-segment', [] ).provider( '$routeSegment',
*/
contains: function (val) {
for(var i=0; i<this.chain.length; i++)
if(this.chain[i].name == val)
if(this.chain[i] && this.chain[i].name == val)
return true;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-route-segment",
"version": "1.2.3",
"version": "1.2.4",
"dependencies": {
"grunt": "",
"grunt-contrib-uglify": "",
Expand Down
2 changes: 1 addition & 1 deletion src/route-segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ angular.module( 'route-segment', [] ).provider( '$routeSegment',
*/
contains: function (val) {
for(var i=0; i<this.chain.length; i++)
if(this.chain[i].name == val)
if(this.chain[i] && this.chain[i].name == val)
return true;
return false;
}
Expand Down

0 comments on commit 990982b

Please sign in to comment.