Преглед на файлове

added lu busy null check

tags/v0.3.3
Robin Thoni преди 7 години
родител
ревизия
31ac2ca2f6
променени са 1 файла, в които са добавени 17 реда и са изтрити 13 реда
  1. 17
    13
      src/Business/lu-busy-business.js

+ 17
- 13
src/Business/lu-busy-business.js Целия файл

@@ -79,15 +79,17 @@
79 79
                 }
80 80
                 for (var i = 0; i < groups.length; ++i) {
81 81
                     var group = luBusyBusiness.groups[groups[i]];
82
-                    --group.count;
83
-                    if (group.count == 0) {
84
-                        if (!luBusyBusiness.hasError(group)) {
85
-                            group.deferred.resolve(null);
86
-                        }
87
-                        else {
88
-                            group.deferred.resolve(null);
82
+                    if (group != null) {
83
+                        --group.count;
84
+                        if (group.count == 0) {
85
+                            if (!luBusyBusiness.hasError(group)) {
86
+                                group.deferred.resolve(null);
87
+                            }
88
+                            else {
89
+                                group.deferred.resolve(null);
90
+                            }
91
+                            group.deferred = null;
89 92
                         }
90
-                        group.deferred = null;
91 93
                     }
92 94
                 }
93 95
             };
@@ -99,11 +101,13 @@
99 101
                 }
100 102
                 for (var i = 0; i < groups.length; ++i) {
101 103
                     var group = luBusyBusiness.groups[groups[i]];
102
-                    --group.count;
103
-                    group.errors.push(error);
104
-                    if (group.count == 0) {
105
-                        group.deferred.resolve(null);
106
-                        group.deferred = null;
104
+                    if (group != null) {
105
+                        --group.count;
106
+                        group.errors.push(error);
107
+                        if (group.count == 0) {
108
+                            group.deferred.resolve(null);
109
+                            group.deferred = null;
110
+                        }
107 111
                     }
108 112
                 }
109 113
             };

Loading…
Отказ
Запис