Skip to content

Commit 6c9f982

Browse files
[fix]common service解绑事件 review by qiw
1 parent 1ece4b1 commit 6c9f982

13 files changed

+25
-24
lines changed

src/common/iServer/AddressMatchService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ export class AddressMatchService extends CommonServiceBase {
7171
if (eventId === result.result.eventId && callback) {
7272
delete result.result.eventId;
7373
callback(result);
74-
this.events.un(eventListeners);
74+
this.events && this.events.un(eventListeners);
7575
return false;
7676
}
7777
},
7878
processFailed: function(result) {
7979
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
8080
callback(result);
81-
this.events.un(eventListeners);
81+
this.events && this.events.un(eventListeners);
8282
return false;
8383
}
8484
}

src/common/iServer/DatasetService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ export class DatasetService extends CommonServiceBase {
103103
if (eventId === result.result.eventId && callback) {
104104
delete result.result.eventId;
105105
callback(result);
106-
this.events.un(eventListeners);
106+
this.events && this.events.un(eventListeners);
107107
return false;
108108
}
109109
},
110110
processFailed: function(result) {
111111
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
112112
callback(result);
113-
this.events.un(eventListeners);
113+
this.events && this.events.un(eventListeners);
114114
return false;
115115
}
116116
}

src/common/iServer/DatasourceService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ export class DatasourceService extends CommonServiceBase {
8080
if (eventId === result.result.eventId && callback) {
8181
delete result.result.eventId;
8282
callback(result);
83-
this.events.un(eventListeners);
83+
this.events && this.events.un(eventListeners);
8484
return false;
8585
}
8686
},
8787
processFailed: function(result) {
8888
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
8989
callback(result);
90-
this.events.un(eventListeners);
90+
this.events && this.events.un(eventListeners);
9191
return false;
9292
}
9393
}

src/common/iServer/GeoprocessingService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,14 @@ export class GeoprocessingService extends CommonServiceBase {
165165
if (eventId === result.result.eventId && callback) {
166166
delete result.result.eventId;
167167
callback(result);
168-
this.events.un(eventListeners);
168+
this.events && this.events.un(eventListeners);
169169
return false;
170170
}
171171
},
172172
processFailed: function(result) {
173173
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
174174
callback(result);
175-
this.events.un(eventListeners);
175+
this.events && this.events.un(eventListeners);
176176
return false;
177177
}
178178
}

src/common/iServer/GetGridCellInfosService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ export class GetGridCellInfosService extends CommonServiceBase {
109109
if (eventId === result.result.eventId && callback) {
110110
delete result.result.eventId;
111111
callback(result);
112-
this.events.un(eventListeners);
112+
this.events && this.events.un(eventListeners);
113113
return false;
114114
}
115115
},
116116
processFailed: function(result) {
117117
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
118118
callback(result);
119-
this.events.un(eventListeners);
119+
this.events && this.events.un(eventListeners);
120120
return false;
121121
}
122122
}

src/common/iServer/ImageCollectionService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ export default class ImageCollectionService extends CommonServiceBase {
123123
if (eventId === result.result.eventId && callback) {
124124
delete result.result.eventId;
125125
callback(result);
126-
this.events.un(eventListeners);
126+
this.events && this.events.un(eventListeners);
127127
return false;
128128
}
129129
},
130130
processFailed: function(result) {
131131
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
132132
callback(result);
133-
this.events.un(eventListeners);
133+
this.events && this.events.un(eventListeners);
134134
return false;
135135
}
136136
}

src/common/iServer/ImageService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ export default class ImageService extends CommonServiceBase {
8484
processCompleted: function (result) {
8585
if (eventId === result.result.eventId && callback) {
8686
callback(result);
87-
this.events.un(eventListeners);
87+
this.events && this.events.un(eventListeners);
8888
return false;
8989
}
9090
},
9191
processFailed: function (result) {
9292
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
9393
callback(result);
94-
this.events.un(eventListeners);
94+
this.events && this.events.un(eventListeners);
9595
return false;
9696
}
9797
}

src/common/iServer/KnowledgeGraphService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,15 @@ export class KnowledgeGraphService extends CommonServiceBase {
220220
if (eventId === result.result.eventId && callback) {
221221
delete result.result.eventId;
222222
callback(result);
223-
this.events.un(eventListeners);
223+
this.events && this.events.un(eventListeners);
224224
return false;
225225
}
226226
},
227227
processFailed: function (result) {
228228
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
229229
delete result.eventId;
230230
callback(result);
231-
this.events.un(eventListeners);
231+
this.events && this.events.un(eventListeners);
232232
return false;
233233
}
234234
}

src/common/iServer/MapService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ export class MapService extends CommonServiceBase {
8585
if (eventId === result.result.eventId && callback) {
8686
delete result.result.eventId;
8787
callback(result);
88-
this.events.un(eventListeners);
88+
this.events && this.events.un(eventListeners);
8989
return false;
9090
}
9191
},
9292
processFailed: function(result) {
9393
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
9494
callback(result);
95-
this.events.un(eventListeners);
95+
this.events && this.events.un(eventListeners);
9696
return false;
9797
}
9898
}

src/common/iServer/MeasureService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ export class MeasureService extends CommonServiceBase {
7373
if (eventId === result.result.eventId && callback) {
7474
delete result.result.eventId;
7575
callback(result);
76-
this.events.un(eventListeners);
76+
this.events && this.events.un(eventListeners);
7777
return false;
7878
}
7979
},
8080
processFailed: function(result) {
8181
if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
8282
callback(result);
83-
this.events.un(eventListeners);
83+
this.events && this.events.un(eventListeners);
8484
return false;
8585
}
8686
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy