Commit 40ff560f3cb48d1c3f55cae5b95da9048aad01fd
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master See merge request !6
Showing
1 changed file
Show diff stats
src/js/controller.js
| ... | ... | @@ -43,10 +43,11 @@ angular.module('focaModalCotizacion') |
| 43 | 43 | }); |
| 44 | 44 | //CONVIERTO FECHAS A UTC-3 |
| 45 | 45 | var fecha = new Date(precio[0].fecha); |
| 46 | - var ultimaFecha = new Date($scope.cotizacion[0].FECHA); | |
| 46 | + var ultimaFecha = | |
| 47 | + ($scope.cotizacion[0]) ? new Date($scope.cotizacion[0].FECHA) : undefined; | |
| 47 | 48 | |
| 48 | 49 | //SI LA ULTIMA COTIZACION YA FUE AGREGADA |
| 49 | - if(fecha.getTime() === ultimaFecha.getTime()) { | |
| 50 | + if(ultimaFecha && fecha.getTime() === ultimaFecha.getTime()) { | |
| 50 | 51 | focaModalService |
| 51 | 52 | .alert('Ya se encuentra la ultima cotización en la tabla'); |
| 52 | 53 | $scope.obteniendoCotizacion = false; |