Skip to content
Snippets Groups Projects
Commit 18f50fb0 authored by Ben Bosman's avatar Ben Bosman
Browse files

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
parent c6de9884
Branches
No related merge requests found
......@@ -51,13 +51,13 @@ export abstract class BaseResponseParsingService {
return this.processArray(data, request);
} else if (isRestDataObject(data)) {
const object = this.deserialize(data);
if (isNotEmpty(data._embedded) && hasValue(object)) {
if (isNotEmpty(data._embedded)) {
Object
.keys(data._embedded)
.filter((property) => data._embedded.hasOwnProperty(property))
.forEach((property) => {
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])) {
object[property] = parsedObj;
object[property].page = parsedObj.page.map((obj) => this.retrieveObjectOrUrl(obj));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment