Don't attempt to deserialize empty invoke responses

This commit is contained in:
Alex Clemmer 2019-11-06 18:41:49 -08:00
parent 05cb51421d
commit e37d23d52d

View file

@ -335,7 +335,7 @@ function serializePropertiesSync(prop: any): any {
}
}
function deserializeResponse(tok: string, resp: any) {
function deserializeResponse(tok: string, resp: any): any {
const failures: any = resp.getFailuresList();
if (failures && failures.length) {
let reasons = "";
@ -350,5 +350,8 @@ function deserializeResponse(tok: string, resp: any) {
throw new Error(`Invoke of '${tok}' failed: ${reasons}`);
}
return deserializeProperties(resp.getReturn());
const ret = resp.getReturn();
return ret === undefined
? ret
: deserializeProperties(ret);
}