Don't attempt to deserialize empty invoke responses
This commit is contained in:
parent
05cb51421d
commit
e37d23d52d
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue