Browse Source

added lu busy null check

tags/v0.3.3
Robin Thoni 7 years ago
parent
commit
31ac2ca2f6
1 changed files with 17 additions and 13 deletions
  1. 17
    13
      src/Business/lu-busy-business.js

+ 17
- 13
src/Business/lu-busy-business.js View File

79
                 }
79
                 }
80
                 for (var i = 0; i < groups.length; ++i) {
80
                 for (var i = 0; i < groups.length; ++i) {
81
                     var group = luBusyBusiness.groups[groups[i]];
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
                 }
101
                 }
100
                 for (var i = 0; i < groups.length; ++i) {
102
                 for (var i = 0; i < groups.length; ++i) {
101
                     var group = luBusyBusiness.groups[groups[i]];
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…
Cancel
Save