Skip to content

Commit

Permalink
#400 added check if headers exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
77bo committed Dec 10, 2017
1 parent 135eacb commit a0490e3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/ngx-uploader/classes/ngx-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,15 @@ export class NgUploaderService {
}

private parseResponseHeaders(httpHeaders: ByteString) {
return httpHeaders.split('\n')
.map(x => x.split(/: */, 2))
.filter(x => x[0])
.reduce((ac, x) => {
ac[x[0]] = x[1];
return ac;
}, {});
if (!httpHeaders) {
return null;
}
return httpHeaders.split('\n')
.map(x => x.split(/: */, 2))
.filter(x => x[0])
.reduce((ac, x) => {
ac[x[0]] = x[1];
return ac;
}, {});
}
}

0 comments on commit a0490e3

Please sign in to comment.