mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
If the data is part of a type not yet known to Angular, the object is null
The null object causes an exception further down the road
This commit is contained in:
@@ -51,13 +51,13 @@ export abstract class BaseResponseParsingService {
|
|||||||
return this.processArray(data, request);
|
return this.processArray(data, request);
|
||||||
} else if (isRestDataObject(data)) {
|
} else if (isRestDataObject(data)) {
|
||||||
const object = this.deserialize(data);
|
const object = this.deserialize(data);
|
||||||
if (isNotEmpty(data._embedded) && hasValue(object)) {
|
if (isNotEmpty(data._embedded)) {
|
||||||
Object
|
Object
|
||||||
.keys(data._embedded)
|
.keys(data._embedded)
|
||||||
.filter((property) => data._embedded.hasOwnProperty(property))
|
.filter((property) => data._embedded.hasOwnProperty(property))
|
||||||
.forEach((property) => {
|
.forEach((property) => {
|
||||||
const parsedObj = this.process<ObjectDomain>(data._embedded[property], request);
|
const parsedObj = this.process<ObjectDomain>(data._embedded[property], request);
|
||||||
if (this.shouldDirectlyAttachEmbeds && isNotEmpty(parsedObj)) {
|
if (hasValue(object) && this.shouldDirectlyAttachEmbeds && isNotEmpty(parsedObj)) {
|
||||||
if (isRestPaginatedList(data._embedded[property])) {
|
if (isRestPaginatedList(data._embedded[property])) {
|
||||||
object[property] = parsedObj;
|
object[property] = parsedObj;
|
||||||
object[property].page = parsedObj.page.map((obj) => this.retrieveObjectOrUrl(obj));
|
object[property].page = parsedObj.page.map((obj) => this.retrieveObjectOrUrl(obj));
|
||||||
|
Reference in New Issue
Block a user