Explorar el Código

Small fix to unsavedChangesSrv, did not handle new template variable correctly

Torkel Ödegaard hace 11 años
padre
commit
481a4b0f1b
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      src/app/features/dashboard/unsavedChangesSrv.js

+ 5 - 2
src/app/features/dashboard/unsavedChangesSrv.js

@@ -88,8 +88,11 @@ function(angular, _, config) {
       _.each(current.templating.list, function(value, index) {
         value.current = null;
         value.options = null;
-        original.templating.list[index].current = null;
-        original.templating.list[index].options = null;
+
+        if (original.templating.list.length > index) {
+          original.templating.list[index].current = null;
+          original.templating.list[index].options = null;
+        }
       });
 
       var currentTimepicker = _.findWhere(current.nav, { type: 'timepicker' });