Sfoglia il codice sorgente

Add existence check for canceler.

stuart nelson 9 anni fa
parent
commit
8797be9f89
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      public/app/core/services/backend_srv.js

+ 3 - 1
public/app/core/services/backend_srv.js

@@ -131,7 +131,9 @@ function (angular, _, coreModule, config) {
         if (requestIsLocal && firstAttempt && err.status === 401) {
         if (requestIsLocal && firstAttempt && err.status === 401) {
           return self.loginPing().then(function() {
           return self.loginPing().then(function() {
             options.retry = 1;
             options.retry = 1;
-            canceler.resolve();
+            if (canceler) {
+              canceler.resolve();
+            }
             return self.datasourceRequest(options);
             return self.datasourceRequest(options);
           });
           });
         }
         }