Skip to content

Commit

Permalink
Handle empty transfer link bodies (vmware-archive#77)
Browse files Browse the repository at this point in the history
Some backend responses return empty bodies when starting a transfer -
for example plugin transfer.

This handles that case.  This is required for the new plugin lifecycle
plugin to work.

Signed-off-by: David Byard <dbyard@vmware.com>
  • Loading branch information
dbyard-vmware authored and jmoroski committed Feb 8, 2019
1 parent ca91a8d commit c3c536f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/api-client/packages/sdk/src/client/vcd.api.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class VcdApiClient {
const headerLinks: LinkType[] = res.headers.has(HATEOAS_HEADER)
? parseHeaderHateoasLinks(res.headers.get(HATEOAS_HEADER))
: [];
const links: LinkType[] = res.body.link || [];
const links: LinkType[] = res.body ? (res.body.link || []) : [];
const link = [...headerLinks, ...links]
.find((link) => link.rel == transferRel);
if (!link) {
Expand Down

0 comments on commit c3c536f

Please sign in to comment.