Fixed recursive loop when value is NaN

Known issue in AngularJS ng-repeat