1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 22:21:13 +03:00

Sockets - avoid sending invalid JSON when entering state with no socket

definition.
This commit is contained in:
Leigh Johnson 2016-10-28 15:39:48 -04:00
parent a49095bdbc
commit d253eabe5d

View File

@ -135,7 +135,7 @@ export default
// to the API: {"groups": {}}.
// This is used for all pages that are socket-disabled
if(this.requiresNewSubscribe(state)){
this.emit(JSON.stringify(state.data.socket));
this.emit(JSON.stringify(state.data.socket) || JSON.stringify({"groups": {}}));
}
this.setLast(state);
},
@ -205,8 +205,8 @@ export default
// requires a subscribe or an unsubscribe
var self = this;
socketPromise.promise.then(function(){
if(!state.data && !state.data.socket){
state.data.socket = {groups: {}};
if(!state.data || !state.data.socket){
_.merge(state.data, {socket: {groups: {}}});
self.unsubscribe(state);
}
else{