Skip to content
Snippets Groups Projects
Commit 5ed2b753 authored by Art Lowel's avatar Art Lowel
Browse files

fix an issue where an empty bitstream page would cause an error

parent 6d443819
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ function isObjectLevel(halObj: any) {
}
function isPaginatedResponse(halObj: any) {
return hasValue(halObj.page) && hasValue(halObj._embedded);
return hasValue(halObj.page);
}
/* tslint:disable:max-classes-per-file */
......@@ -77,7 +77,9 @@ export abstract class BaseResponseParsingService {
let list = data._embedded;
// Workaround for inconsistency in rest response. Issue: https://github.com/DSpace/dspace-angular/issues/238
if (!Array.isArray(list)) {
if (hasNoValue(list)) {
list = [];
} else if (!Array.isArray(list)) {
list = this.flattenSingleKeyObject(list);
}
const page: ObjectDomain[] = this.processArray(list, requestHref);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment