mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 04:23:04 +00:00
fix an issue where an empty bitstream page would cause an error
This commit is contained in:
@@ -14,7 +14,7 @@ function isObjectLevel(halObj: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isPaginatedResponse(halObj: any) {
|
function isPaginatedResponse(halObj: any) {
|
||||||
return hasValue(halObj.page) && hasValue(halObj._embedded);
|
return hasValue(halObj.page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tslint:disable:max-classes-per-file */
|
/* tslint:disable:max-classes-per-file */
|
||||||
@@ -77,7 +77,9 @@ export abstract class BaseResponseParsingService {
|
|||||||
let list = data._embedded;
|
let list = data._embedded;
|
||||||
|
|
||||||
// Workaround for inconsistency in rest response. Issue: https://github.com/DSpace/dspace-angular/issues/238
|
// 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);
|
list = this.flattenSingleKeyObject(list);
|
||||||
}
|
}
|
||||||
const page: ObjectDomain[] = this.processArray(list, requestHref);
|
const page: ObjectDomain[] = this.processArray(list, requestHref);
|
||||||
|
Reference in New Issue
Block a user